@poe-platform/safe-js 0.1.159 → 0.1.160

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.
@@ -33999,66 +33999,92 @@ function createSymbolGlobal(budget) {
33999
33999
  });
34000
34000
  Object.defineProperties(prototype, {
34001
34001
  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({
34002
+ toString: {
34003
+ value: createSandboxClosure({
34004
+ sandbox: true,
34005
+ name: "toString",
34006
+ length: 0,
34007
+ call: (_args, context) => budget.allocateString(String(primitiveReceiver(context?.thisValue, "symbol")))
34008
+ }),
34009
+ writable: true,
34010
+ configurable: true
34011
+ },
34012
+ description: {
34013
+ get: accessorAdapter(
34014
+ createSandboxClosure({
34015
+ sandbox: true,
34016
+ name: "get description",
34017
+ length: 0,
34018
+ call: (_args, context) => {
34019
+ const value = primitiveReceiver(context?.thisValue, "symbol");
34020
+ if (typeof value !== "symbol") throw new TypeError("Expected Symbol receiver");
34021
+ return value.description;
34022
+ }
34023
+ }),
34024
+ "get"
34025
+ ),
34026
+ configurable: true
34027
+ }
34028
+ });
34029
+ Object.defineProperty(prototype, Symbol.toPrimitive, {
34030
+ value: createSandboxClosure({
34009
34031
  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 }
34032
+ name: "[Symbol.toPrimitive]",
34033
+ length: 1,
34034
+ call: (_args, context) => primitiveReceiver(context?.thisValue, "symbol")
34035
+ }),
34036
+ configurable: true
34018
34037
  });
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
34038
  Object.defineProperty(prototype, Symbol.toStringTag, { value: "Symbol", configurable: true });
34026
34039
  const constructor = createSandboxClosure({
34040
+ guest: true,
34027
34041
  sandbox: true,
34028
34042
  name: "Symbol",
34029
34043
  length: 0,
34030
34044
  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;
34045
+ call: async ([description], context) => Symbol(
34046
+ description === void 0 ? void 0 : await sandboxString(description, budget, context)
34047
+ )
34048
+ });
34049
+ const properties = materializeFunctionProperties(constructor);
34050
+ Object.defineProperty(properties, "prototype", { value: prototype });
34051
+ const methods = {
34052
+ for: createSandboxClosure({
34053
+ sandbox: true,
34054
+ name: "for",
34055
+ length: 1,
34056
+ call: async ([key], context) => {
34057
+ const text = await sandboxString(key, budget, context);
34058
+ let value = entries.get(text);
34059
+ if (value === void 0) {
34060
+ value = Symbol(text);
34061
+ entries.set(text, value);
34056
34062
  }
34057
- }),
34058
- ...wellKnownSymbols
34059
- }
34063
+ return value;
34064
+ }
34065
+ }),
34066
+ keyFor: createSandboxClosure({
34067
+ sandbox: true,
34068
+ name: "keyFor",
34069
+ length: 1,
34070
+ call: ([value]) => {
34071
+ if (typeof value !== "symbol") throw new TypeError("Symbol.keyFor requires a symbol.");
34072
+ for (const [key, registered] of entries) if (registered === value) return key;
34073
+ return void 0;
34074
+ }
34075
+ })
34076
+ };
34077
+ for (const [name, method] of Object.entries(methods)) {
34078
+ Object.defineProperty(properties, name, { value: method, writable: true, configurable: true });
34079
+ }
34080
+ for (const [name, value] of Object.entries(wellKnownSymbols)) {
34081
+ Object.defineProperty(properties, name, { value });
34082
+ }
34083
+ Object.defineProperty(prototype, "constructor", {
34084
+ value: constructor,
34085
+ writable: true,
34086
+ configurable: true
34060
34087
  });
34061
- Object.defineProperty(prototype, "constructor", { value: constructor, writable: true, configurable: true });
34062
34088
  installBoxedPrototype(budget, prototype, constructor, "symbol");
34063
34089
  return constructor;
34064
34090
  }
@@ -36186,4 +36212,4 @@ export {
36186
36212
  FileSnapshotBackend,
36187
36213
  run
36188
36214
  };
36189
- //# sourceMappingURL=chunk-PG6YTTQI.js.map
36215
+ //# sourceMappingURL=chunk-56X2TO4E.js.map