@poe-platform/safe-js 0.1.386 → 0.1.387

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.
@@ -27,7 +27,7 @@ import {
27
27
  validateMigrationSemantics,
28
28
  validateSnapshotData,
29
29
  validateSnapshotMigration
30
- } from "./chunk-XJL73BPS.js";
30
+ } from "./chunk-KSILYYRR.js";
31
31
 
32
32
  // packages/safe-js/src/migrate.ts
33
33
  import { createHash } from "node:crypto";
@@ -8249,4 +8249,4 @@ export {
8249
8249
  parseMcpConfig,
8250
8250
  makeMcpModule
8251
8251
  };
8252
- //# sourceMappingURL=chunk-IZEDCQDW.js.map
8252
+ //# sourceMappingURL=chunk-D6I4WNJU.js.map
@@ -26347,6 +26347,48 @@ function createGeneratorPrototypes(budget) {
26347
26347
  generatorPrototypes.set(budget, state);
26348
26348
  }
26349
26349
 
26350
+ // packages/safe-js/src/interp/globals/iterator.ts
26351
+ function createIteratorGlobal(budget) {
26352
+ const prototype = resolveIntrinsicIdentity(budget, '["%IteratorPrototype%"]');
26353
+ const constructor = createSandboxClosure({
26354
+ guest: true,
26355
+ sandbox: true,
26356
+ name: "Iterator",
26357
+ length: 0,
26358
+ call: () => {
26359
+ throw new TypeError("Iterator is an abstract constructor.");
26360
+ },
26361
+ construct: async (_args, context) => {
26362
+ const target = context?.newTarget;
26363
+ if (target === void 0 || target === constructor)
26364
+ throw new TypeError("Iterator is an abstract constructor.");
26365
+ const parent = context?.getProperty !== void 0 ? await context.getProperty(target, "prototype") : await readPropertyDescriptor(getSandboxPropertyDescriptor(target, "prototype", budget) ?? { value: void 0 }, target, context);
26366
+ const instance = /* @__PURE__ */ Object.create(null);
26367
+ setSandboxPrototype(instance, parent !== null && typeof parent === "object" ? parent : prototype, budget);
26368
+ createDataCheckpoint(budget, context)(instance, 0, true);
26369
+ return instance;
26370
+ }
26371
+ });
26372
+ Object.defineProperty(materializeFunctionProperties(constructor), "prototype", { value: prototype, writable: false });
26373
+ const getter = createSandboxClosure({ guest: true, sandbox: true, name: "get constructor", length: 0, call: () => constructor });
26374
+ const setter = createSandboxClosure({ guest: true, sandbox: true, name: "set constructor", length: 1, call: async ([value], context) => {
26375
+ const receiver = context?.thisValue;
26376
+ if (receiver === prototype || receiver === null || typeof receiver !== "object")
26377
+ throw new TypeError("Iterator constructor setter requires a distinct object receiver.");
26378
+ const properties = objectProperties(receiver, true);
26379
+ if (Object.hasOwn(properties, "constructor")) await setSandboxProperty(receiver, "constructor", value, budget, true, context);
26380
+ else defineOwnDataProperty(properties, "constructor", value);
26381
+ createDataCheckpoint(budget, context)(receiver, 0, true);
26382
+ return void 0;
26383
+ } });
26384
+ Object.defineProperty(prototype, "constructor", { get: accessorAdapter(getter, "get"), set: accessorAdapter(setter, "set"), configurable: true });
26385
+ registerIntrinsicFunction(budget, getter);
26386
+ registerIntrinsicFunction(budget, setter);
26387
+ registerIntrinsicFunction(budget, constructor);
26388
+ registerIntrinsicObject(budget, prototype);
26389
+ return constructor;
26390
+ }
26391
+
26350
26392
  // packages/safe-js/src/interp/globals/symbol.ts
26351
26393
  var registries = /* @__PURE__ */ new WeakMap();
26352
26394
  function createSymbolGlobal(budget) {
@@ -26969,6 +27011,7 @@ function createBuiltinBindings(options) {
26969
27011
  ...createErrorGlobals({ ...options, errorPrototypes: options.errorPrototypes !== false }),
26970
27012
  ...createMathGlobals({ random: options.random, budget: options.budget }),
26971
27013
  ...createObjectArrayGlobals(options),
27014
+ Iterator: createIteratorGlobal(options.budget),
26972
27015
  Reflect: createReflectGlobal(options.budget),
26973
27016
  ArrayBuffer: createArrayBufferGlobal(options.budget),
26974
27017
  DataView: createDataViewGlobal(options.budget),
@@ -31691,6 +31734,7 @@ var KNOWN_RUNTIME_GLOBALS = [
31691
31734
  "Infinity",
31692
31735
  "isFinite",
31693
31736
  "isNaN",
31737
+ "Iterator",
31694
31738
  "JSON",
31695
31739
  "Map",
31696
31740
  ...Object.keys(numericTypedArrayConstructors),
@@ -44193,4 +44237,4 @@ export {
44193
44237
  FileSnapshotBackend,
44194
44238
  run
44195
44239
  };
44196
- //# sourceMappingURL=chunk-XJL73BPS.js.map
44240
+ //# sourceMappingURL=chunk-KSILYYRR.js.map