@poe-platform/safe-js 0.1.344 → 0.1.346

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-TDLJESOA.js";
30
+ } from "./chunk-X2P45BAH.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-2PROU4RQ.js.map
8252
+ //# sourceMappingURL=chunk-45INMY3D.js.map
@@ -14883,7 +14883,7 @@ function createFloat32ArrayPrototypes(budget, constructor) {
14883
14883
  getters.push(getter);
14884
14884
  Object.defineProperty(shared, key, { get: accessorAdapter(getter, "get"), configurable: true });
14885
14885
  }
14886
- for (const key of ["set", "slice", "subarray", "fill", "copyWithin", "reverse", "at", "includes", "indexOf", "lastIndexOf", "forEach", "every", "some", "find", "findIndex", "findLast", "findLastIndex", "reduce", "reduceRight", "map", "filter", "toLocaleString"])
14886
+ for (const key of ["set", "slice", "subarray", "fill", "copyWithin", "reverse", "toReversed", "at", "includes", "indexOf", "lastIndexOf", "forEach", "every", "some", "find", "findIndex", "findLast", "findLastIndex", "sort", "reduce", "reduceRight", "map", "filter", "toLocaleString"])
14887
14887
  Object.defineProperty(shared, key, { value: getFloat32Member(new Float32Array(0), key, budget, constructor), writable: true, configurable: true });
14888
14888
  const arrayPrototype = resolveIntrinsicIdentity(budget, '["Array","prototype"]');
14889
14889
  Object.defineProperty(shared, "toString", { value: getSandboxDataProperty(arrayPrototype, "toString", budget), writable: true, configurable: true });
@@ -14965,18 +14965,36 @@ function getFloat32Member(value, property, budget, defaultConstructor) {
14965
14965
  if (key === "byteLength") return storage.length * 4;
14966
14966
  if (key === "byteOffset") return storage.byteOffset;
14967
14967
  if (key === "BYTES_PER_ELEMENT") return 4;
14968
- if (!["set", "slice", "subarray", "fill", "copyWithin", "reverse", "at", "includes", "indexOf", "lastIndexOf", "forEach", "every", "some", "find", "findIndex", "findLast", "findLastIndex", "reduce", "reduceRight", "map", "filter", "toLocaleString"].includes(key)) return void 0;
14968
+ if (!["set", "slice", "subarray", "fill", "copyWithin", "reverse", "toReversed", "at", "includes", "indexOf", "lastIndexOf", "forEach", "every", "some", "find", "findIndex", "findLast", "findLastIndex", "sort", "reduce", "reduceRight", "map", "filter", "toLocaleString"].includes(key)) return void 0;
14969
14969
  const numberPrototype = key === "toLocaleString" ? getBoxedPrototype(0, budget) : void 0;
14970
14970
  return createSandboxClosure({
14971
14971
  guest: true,
14972
14972
  sandbox: true,
14973
14973
  name: key,
14974
- length: key === "reverse" || key === "toLocaleString" ? 0 : key === "reduce" || key === "reduceRight" || key === "map" || key === "filter" || key === "set" || key === "fill" || key === "at" || key === "includes" || key === "indexOf" || key === "lastIndexOf" || key === "forEach" || key === "every" || key === "some" || key === "find" || key === "findIndex" || key === "findLast" || key === "findLastIndex" ? 1 : 2,
14974
+ length: key === "reverse" || key === "toReversed" || key === "toLocaleString" ? 0 : key === "sort" || key === "reduce" || key === "reduceRight" || key === "map" || key === "filter" || key === "set" || key === "fill" || key === "at" || key === "includes" || key === "indexOf" || key === "lastIndexOf" || key === "forEach" || key === "every" || key === "some" || key === "find" || key === "findIndex" || key === "findLast" || key === "findLastIndex" ? 1 : 2,
14975
14975
  call: (args, context) => {
14976
+ if (key === "sort" && args[0] !== void 0 && !isSandboxClosure(args[0]))
14977
+ throw new TypeError("TypedArray sort comparator must be callable.");
14976
14978
  const receiver = context?.thisValue;
14977
14979
  if (!isFloat32Array(receiver))
14978
14980
  throw new TypeError(`Float32Array#${key} requires a Float32Array receiver.`);
14979
- const storage2 = float32Storage(receiver, key === "reduce" || key === "reduceRight" || key === "map" || key === "filter" || key === "slice" || key === "fill" || key === "copyWithin" || key === "reverse" || key === "at" || key === "includes" || key === "indexOf" || key === "lastIndexOf" || key === "forEach" || key === "every" || key === "some" || key === "find" || key === "findIndex" || key === "findLast" || key === "findLastIndex" || key === "toLocaleString");
14981
+ const storage2 = float32Storage(receiver, key === "sort" || key === "reduce" || key === "reduceRight" || key === "map" || key === "filter" || key === "slice" || key === "fill" || key === "copyWithin" || key === "reverse" || key === "toReversed" || key === "at" || key === "includes" || key === "indexOf" || key === "lastIndexOf" || key === "forEach" || key === "every" || key === "some" || key === "find" || key === "findIndex" || key === "findLast" || key === "findLastIndex" || key === "toLocaleString");
14982
+ if (key === "toReversed") {
14983
+ let result;
14984
+ const release = retainValues(budget, () => [receiver, result, ...args]);
14985
+ try {
14986
+ checkFloat32Allocation(storage2.length, budget);
14987
+ result = new Float32Array(storage2.length);
14988
+ createDataCheckpoint(budget, context)(result, 0, true);
14989
+ for (let index = 0; index < storage2.length; index++) {
14990
+ budget.visitNode();
14991
+ result[index] = receiver[storage2.length - index - 1];
14992
+ }
14993
+ return result;
14994
+ } finally {
14995
+ release();
14996
+ }
14997
+ }
14980
14998
  if (key === "reverse") {
14981
14999
  const release = retainValues(budget, () => [receiver, ...args]);
14982
15000
  try {
@@ -15005,6 +15023,66 @@ function getFloat32Member(value, property, budget, defaultConstructor) {
15005
15023
  }),
15006
15024
  invokeClosure: context?.invokeClosure ?? ((callee, values, thisValue, construct) => invokeBuiltinClosure(callee, values, budget, context, thisValue, construct))
15007
15025
  };
15026
+ if (key === "sort") {
15027
+ const comparator = args[0];
15028
+ if (storage2.length < 2) return receiver;
15029
+ return (async () => {
15030
+ let items;
15031
+ let scratch;
15032
+ let comparisonResult;
15033
+ const release = retainValues(budget, () => [receiver, items, scratch, comparisonResult, ...args]);
15034
+ const checkData = createDataCheckpoint(budget, bridge);
15035
+ try {
15036
+ checkFloat32Allocation(storage2.length, budget);
15037
+ items = new Float32Array(storage2.length);
15038
+ checkData(items, 0, true);
15039
+ checkFloat32Allocation(storage2.length, budget);
15040
+ scratch = new Float32Array(storage2.length);
15041
+ checkData(scratch, 0, true);
15042
+ for (let index = 0; index < storage2.length; index++) {
15043
+ budget.visitNode();
15044
+ items[index] = receiver[index];
15045
+ }
15046
+ for (let width = 1; width < storage2.length; width *= 2) {
15047
+ for (let start = 0; start < storage2.length; start += width * 2) {
15048
+ const middle = Math.min(start + width, storage2.length);
15049
+ const end = Math.min(start + width * 2, storage2.length);
15050
+ let left = start;
15051
+ let right = middle;
15052
+ for (let output = start; output < end; output++) {
15053
+ budget.visitNode();
15054
+ let takeLeft = right === end;
15055
+ if (left < middle && right < end) {
15056
+ const a = items[left];
15057
+ const b = items[right];
15058
+ let order;
15059
+ if (comparator !== void 0) {
15060
+ comparisonResult = await invokeBuiltinClosure(comparator, [a, b], budget, bridge, void 0);
15061
+ order = await sandboxNumber(comparisonResult, budget, bridge);
15062
+ if (Number.isNaN(order)) order = 0;
15063
+ } else if (Number.isNaN(a)) order = Number.isNaN(b) ? 0 : 1;
15064
+ else if (Number.isNaN(b)) order = -1;
15065
+ else if (a === 0 && b === 0) order = Object.is(a, -0) ? Object.is(b, -0) ? 0 : -1 : Object.is(b, -0) ? 1 : 0;
15066
+ else order = a < b ? -1 : a > b ? 1 : 0;
15067
+ takeLeft = order <= 0;
15068
+ }
15069
+ scratch[output] = takeLeft ? items[left++] : items[right++];
15070
+ }
15071
+ }
15072
+ const previous = items;
15073
+ items = scratch;
15074
+ scratch = previous;
15075
+ }
15076
+ for (let index = 0; index < storage2.length; index++) {
15077
+ budget.visitNode();
15078
+ receiver[index] = items[index];
15079
+ }
15080
+ return receiver;
15081
+ } finally {
15082
+ release();
15083
+ }
15084
+ })();
15085
+ }
15008
15086
  if (key === "toLocaleString") {
15009
15087
  return (async () => {
15010
15088
  let text = "";
@@ -42554,4 +42632,4 @@ export {
42554
42632
  FileSnapshotBackend,
42555
42633
  run
42556
42634
  };
42557
- //# sourceMappingURL=chunk-TDLJESOA.js.map
42635
+ //# sourceMappingURL=chunk-X2P45BAH.js.map