@poe-platform/safe-js 0.1.159 → 0.1.161

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16497,10 +16497,12 @@ async function evaluateSpreadElement(node, context) {
16497
16497
  if (typeof next !== "object" || next === null) {
16498
16498
  throw new TypeError("Iterator result must be an object.");
16499
16499
  }
16500
- if ((await readIteratorResult(iterator, next, "done")).value) {
16500
+ const done = iterator.readResultProperty === void 0 ? next.done : (await readIteratorResult(iterator, next, "done")).value;
16501
+ if (done) {
16501
16502
  break;
16502
16503
  }
16503
- spreadValues.push((await readIteratorResult(iterator, next, "value")).value);
16504
+ const item = iterator.readResultProperty === void 0 ? next.value : (await readIteratorResult(iterator, next, "value")).value;
16505
+ spreadValues.push(item);
16504
16506
  context.budget.allocateArrayLength(spreadValues.length);
16505
16507
  }
16506
16508
  return {
@@ -33999,66 +34001,92 @@ function createSymbolGlobal(budget) {
33999
34001
  });
34000
34002
  Object.defineProperties(prototype, {
34001
34003
  valueOf: { value: valueOf, writable: true, configurable: true },
34002
- toString: { value: createSandboxClosure({
34003
- sandbox: true,
34004
- name: "toString",
34005
- length: 0,
34006
- call: (_args, context) => budget.allocateString(String(primitiveReceiver(context?.thisValue, "symbol")))
34007
- }), writable: true, configurable: true },
34008
- description: { get: accessorAdapter(createSandboxClosure({
34004
+ toString: {
34005
+ value: createSandboxClosure({
34006
+ sandbox: true,
34007
+ name: "toString",
34008
+ length: 0,
34009
+ call: (_args, context) => budget.allocateString(String(primitiveReceiver(context?.thisValue, "symbol")))
34010
+ }),
34011
+ writable: true,
34012
+ configurable: true
34013
+ },
34014
+ description: {
34015
+ get: accessorAdapter(
34016
+ createSandboxClosure({
34017
+ sandbox: true,
34018
+ name: "get description",
34019
+ length: 0,
34020
+ call: (_args, context) => {
34021
+ const value = primitiveReceiver(context?.thisValue, "symbol");
34022
+ if (typeof value !== "symbol") throw new TypeError("Expected Symbol receiver");
34023
+ return value.description;
34024
+ }
34025
+ }),
34026
+ "get"
34027
+ ),
34028
+ configurable: true
34029
+ }
34030
+ });
34031
+ Object.defineProperty(prototype, Symbol.toPrimitive, {
34032
+ value: createSandboxClosure({
34009
34033
  sandbox: true,
34010
- name: "get description",
34011
- length: 0,
34012
- call: (_args, context) => {
34013
- const value = primitiveReceiver(context?.thisValue, "symbol");
34014
- if (typeof value !== "symbol") throw new TypeError("Expected Symbol receiver");
34015
- return value.description;
34016
- }
34017
- }), "get"), configurable: true }
34034
+ name: "[Symbol.toPrimitive]",
34035
+ length: 1,
34036
+ call: (_args, context) => primitiveReceiver(context?.thisValue, "symbol")
34037
+ }),
34038
+ configurable: true
34018
34039
  });
34019
- Object.defineProperty(prototype, Symbol.toPrimitive, { value: createSandboxClosure({
34020
- sandbox: true,
34021
- name: "[Symbol.toPrimitive]",
34022
- length: 1,
34023
- call: (_args, context) => primitiveReceiver(context?.thisValue, "symbol")
34024
- }), configurable: true });
34025
34040
  Object.defineProperty(prototype, Symbol.toStringTag, { value: "Symbol", configurable: true });
34026
34041
  const constructor = createSandboxClosure({
34042
+ guest: true,
34027
34043
  sandbox: true,
34028
34044
  name: "Symbol",
34029
34045
  length: 0,
34030
34046
  retainedValues: () => [...entries.keys(), ...entries.values()],
34031
- call: async ([description], context) => Symbol(description === void 0 ? void 0 : await sandboxString(description, budget, context)),
34032
- properties: {
34033
- prototype,
34034
- for: createSandboxClosure({
34035
- sandbox: true,
34036
- name: "for",
34037
- length: 1,
34038
- call: async ([key], context) => {
34039
- const text = await sandboxString(key, budget, context);
34040
- let value = entries.get(text);
34041
- if (value === void 0) {
34042
- value = Symbol(text);
34043
- entries.set(text, value);
34044
- }
34045
- return value;
34046
- }
34047
- }),
34048
- keyFor: createSandboxClosure({
34049
- sandbox: true,
34050
- name: "keyFor",
34051
- length: 1,
34052
- call: ([value]) => {
34053
- if (typeof value !== "symbol") throw new TypeError("Symbol.keyFor requires a symbol.");
34054
- for (const [key, registered] of entries) if (registered === value) return key;
34055
- return void 0;
34047
+ call: async ([description], context) => Symbol(
34048
+ description === void 0 ? void 0 : await sandboxString(description, budget, context)
34049
+ )
34050
+ });
34051
+ const properties = materializeFunctionProperties(constructor);
34052
+ Object.defineProperty(properties, "prototype", { value: prototype });
34053
+ const methods = {
34054
+ for: createSandboxClosure({
34055
+ sandbox: true,
34056
+ name: "for",
34057
+ length: 1,
34058
+ call: async ([key], context) => {
34059
+ const text = await sandboxString(key, budget, context);
34060
+ let value = entries.get(text);
34061
+ if (value === void 0) {
34062
+ value = Symbol(text);
34063
+ entries.set(text, value);
34056
34064
  }
34057
- }),
34058
- ...wellKnownSymbols
34059
- }
34065
+ return value;
34066
+ }
34067
+ }),
34068
+ keyFor: createSandboxClosure({
34069
+ sandbox: true,
34070
+ name: "keyFor",
34071
+ length: 1,
34072
+ call: ([value]) => {
34073
+ if (typeof value !== "symbol") throw new TypeError("Symbol.keyFor requires a symbol.");
34074
+ for (const [key, registered] of entries) if (registered === value) return key;
34075
+ return void 0;
34076
+ }
34077
+ })
34078
+ };
34079
+ for (const [name, method] of Object.entries(methods)) {
34080
+ Object.defineProperty(properties, name, { value: method, writable: true, configurable: true });
34081
+ }
34082
+ for (const [name, value] of Object.entries(wellKnownSymbols)) {
34083
+ Object.defineProperty(properties, name, { value });
34084
+ }
34085
+ Object.defineProperty(prototype, "constructor", {
34086
+ value: constructor,
34087
+ writable: true,
34088
+ configurable: true
34060
34089
  });
34061
- Object.defineProperty(prototype, "constructor", { value: constructor, writable: true, configurable: true });
34062
34090
  installBoxedPrototype(budget, prototype, constructor, "symbol");
34063
34091
  return constructor;
34064
34092
  }
@@ -36186,4 +36214,4 @@ export {
36186
36214
  FileSnapshotBackend,
36187
36215
  run
36188
36216
  };
36189
- //# sourceMappingURL=chunk-PG6YTTQI.js.map
36217
+ //# sourceMappingURL=chunk-AR5OJ6OJ.js.map