@poe-platform/safe-js 0.1.285 → 0.1.287

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.
@@ -7954,10 +7954,7 @@ function releaseObjectPrototype(budget) {
7954
7954
  }
7955
7955
  function getSandboxPrototype(value, budget) {
7956
7956
  if (prototypes.has(value)) return prototypes.get(value) ?? null;
7957
- if (budget !== void 0 && isSandboxDate(value)) {
7958
- const prototype = datePrototypes.get(budget);
7959
- return prototype === value ? intrinsicPrototypes.get(budget) ?? null : prototype ?? null;
7960
- }
7957
+ if (budget !== void 0 && isSandboxDate(value)) return datePrototypes.get(budget) ?? null;
7961
7958
  if (budget !== void 0 && isSandboxPromise(value)) return promisePrototypes.get(budget) ?? null;
7962
7959
  if (budget !== void 0 && (isSandboxMap(value) || isSandboxSet(value)))
7963
7960
  return collectionPrototypes.get(budget)?.get(isSandboxMap(value) ? "Map" : "Set") ?? null;
@@ -21874,19 +21871,19 @@ function createDateGlobal(options) {
21874
21871
  }
21875
21872
  }
21876
21873
  );
21877
- const now = wrapCallerInjectedBindings({ now: readNow }, { ...options, moduleId: "<Date>" }).now;
21878
- const prototype = createSandboxDate(NaN);
21874
+ const clock = wrapCallerInjectedBindings({ now: readNow }, { ...options, moduleId: "<Date>" }).now;
21875
+ const prototype = /* @__PURE__ */ Object.create(null);
21879
21876
  const constructor = createSandboxClosure({
21880
21877
  guest: true,
21881
21878
  sandbox: true,
21882
21879
  name: "Date",
21883
21880
  length: 7,
21884
21881
  call: async (_args, context) => options.budget.allocateString(
21885
- dateString(createSandboxDate(Number(await now.call([], context))))
21882
+ dateString(createSandboxDate(Number(await clock.call([], context))))
21886
21883
  ),
21887
21884
  construct: async (args, context) => {
21888
21885
  let time;
21889
- if (args.length === 0) time = Number(await now.call([], context));
21886
+ if (args.length === 0) time = Number(await clock.call([], context));
21890
21887
  else if (args.length > 1) time = await coerceDateParts(args, false, options.budget, context);
21891
21888
  else if (isSandboxDate(args[0])) time = dateTime(args[0]);
21892
21889
  else {
@@ -21904,15 +21901,25 @@ function createDateGlobal(options) {
21904
21901
  }
21905
21902
  });
21906
21903
  const staticProperties = {
21907
- now,
21904
+ now: createSandboxClosure({
21905
+ guest: true,
21906
+ sandbox: true,
21907
+ name: "now",
21908
+ length: 0,
21909
+ retainedValues: () => [clock],
21910
+ // Date.now ignores arguments; none may enter the host copy boundary.
21911
+ call: (_args, context) => clock.call([], context)
21912
+ }),
21908
21913
  prototype,
21909
21914
  parse: createSandboxClosure({
21915
+ guest: true,
21910
21916
  sandbox: true,
21911
21917
  name: "parse",
21912
21918
  length: 1,
21913
21919
  call: async ([value], context) => parseDate(await sandboxString(value, options.budget, context), options.budget)
21914
21920
  }),
21915
21921
  UTC: createSandboxClosure({
21922
+ guest: true,
21916
21923
  sandbox: true,
21917
21924
  name: "UTC",
21918
21925
  length: 7,
@@ -40330,4 +40337,4 @@ export {
40330
40337
  FileSnapshotBackend,
40331
40338
  run
40332
40339
  };
40333
- //# sourceMappingURL=chunk-O3NO3NGW.js.map
40340
+ //# sourceMappingURL=chunk-OK6MNHBQ.js.map