@poe-platform/safe-js 0.1.286 → 0.1.288

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.
@@ -6933,6 +6933,7 @@ var methodNames = [
6933
6933
  "getDate",
6934
6934
  "getDay",
6935
6935
  "getFullYear",
6936
+ "getYear",
6936
6937
  "getHours",
6937
6938
  "getMilliseconds",
6938
6939
  "getMinutes",
@@ -6950,6 +6951,7 @@ var methodNames = [
6950
6951
  "setTime",
6951
6952
  "setDate",
6952
6953
  "setFullYear",
6954
+ "setYear",
6953
6955
  "setHours",
6954
6956
  "setMilliseconds",
6955
6957
  "setMinutes",
@@ -6971,7 +6973,7 @@ var methodNames = [
6971
6973
  ];
6972
6974
  var dateMethods = new Map(
6973
6975
  methodNames.map((name) => {
6974
- const native = NativeDate.prototype[name];
6976
+ const native = Object.getOwnPropertyDescriptor(NativeDate.prototype, name).value;
6975
6977
  return [
6976
6978
  name,
6977
6979
  {
@@ -21871,7 +21873,7 @@ function createDateGlobal(options) {
21871
21873
  }
21872
21874
  }
21873
21875
  );
21874
- const now = wrapCallerInjectedBindings({ now: readNow }, { ...options, moduleId: "<Date>" }).now;
21876
+ const clock = wrapCallerInjectedBindings({ now: readNow }, { ...options, moduleId: "<Date>" }).now;
21875
21877
  const prototype = /* @__PURE__ */ Object.create(null);
21876
21878
  const constructor = createSandboxClosure({
21877
21879
  guest: true,
@@ -21879,11 +21881,11 @@ function createDateGlobal(options) {
21879
21881
  name: "Date",
21880
21882
  length: 7,
21881
21883
  call: async (_args, context) => options.budget.allocateString(
21882
- dateString(createSandboxDate(Number(await now.call([], context))))
21884
+ dateString(createSandboxDate(Number(await clock.call([], context))))
21883
21885
  ),
21884
21886
  construct: async (args, context) => {
21885
21887
  let time;
21886
- if (args.length === 0) time = Number(await now.call([], context));
21888
+ if (args.length === 0) time = Number(await clock.call([], context));
21887
21889
  else if (args.length > 1) time = await coerceDateParts(args, false, options.budget, context);
21888
21890
  else if (isSandboxDate(args[0])) time = dateTime(args[0]);
21889
21891
  else {
@@ -21901,15 +21903,25 @@ function createDateGlobal(options) {
21901
21903
  }
21902
21904
  });
21903
21905
  const staticProperties = {
21904
- now,
21906
+ now: createSandboxClosure({
21907
+ guest: true,
21908
+ sandbox: true,
21909
+ name: "now",
21910
+ length: 0,
21911
+ retainedValues: () => [clock],
21912
+ // Date.now ignores arguments; none may enter the host copy boundary.
21913
+ call: (_args, context) => clock.call([], context)
21914
+ }),
21905
21915
  prototype,
21906
21916
  parse: createSandboxClosure({
21917
+ guest: true,
21907
21918
  sandbox: true,
21908
21919
  name: "parse",
21909
21920
  length: 1,
21910
21921
  call: async ([value], context) => parseDate(await sandboxString(value, options.budget, context), options.budget)
21911
21922
  }),
21912
21923
  UTC: createSandboxClosure({
21924
+ guest: true,
21913
21925
  sandbox: true,
21914
21926
  name: "UTC",
21915
21927
  length: 7,
@@ -21937,6 +21949,7 @@ function createDateGlobal(options) {
21937
21949
  }
21938
21950
  })
21939
21951
  );
21952
+ methods.set("toGMTString", methods.get("toUTCString"));
21940
21953
  methods.set(Symbol.toPrimitive, createSandboxClosure({
21941
21954
  guest: true,
21942
21955
  sandbox: true,
@@ -21968,7 +21981,7 @@ async function coerceDateSetter(name, receiver, args, budget, context) {
21968
21981
  const initialTime = dateTime(receiver);
21969
21982
  const converted = [];
21970
21983
  for (const value of args.slice(0, method.length)) converted.push(await sandboxNumber(value, budget, context));
21971
- if (Number.isNaN(initialTime) && name !== "setTime" && !name.endsWith("FullYear")) return NaN;
21984
+ if (Number.isNaN(initialTime) && name !== "setTime" && name !== "setYear" && !name.endsWith("FullYear")) return NaN;
21972
21985
  const result = method.invoke(createSandboxDate(initialTime), converted);
21973
21986
  return dateMethods.get("setTime").invoke(receiver, [result]);
21974
21987
  }
@@ -40327,4 +40340,4 @@ export {
40327
40340
  FileSnapshotBackend,
40328
40341
  run
40329
40342
  };
40330
- //# sourceMappingURL=chunk-HEI7BJVB.js.map
40343
+ //# sourceMappingURL=chunk-K45MDTVS.js.map