@poe-platform/safe-js 0.1.312 → 0.1.313

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.
@@ -14878,29 +14878,46 @@ function getFloat32Member(value, property, budget) {
14878
14878
  throw new TypeError(`Float32Array#${key} requires a Float32Array receiver.`);
14879
14879
  const storage2 = float32Storage(receiver);
14880
14880
  if (key === "set") {
14881
- const [source, offsetValue = 0] = args;
14882
- if (!Array.isArray(source) && !isFloat32Array(source))
14883
- throw new TypeError("Float32Array#set requires an array or Float32Array.");
14884
- const number = float32Number(offsetValue);
14885
- const offset = Number.isNaN(number) ? 0 : Math.trunc(number);
14886
- const length2 = isFloat32Array(source) ? float32Storage(source).length : source.length;
14887
- if (offset < 0 || !Number.isSafeInteger(offset) || offset + length2 > storage2.length)
14888
- throw new RangeError("Float32Array#set source is out of bounds.");
14889
- if (isFloat32Array(source)) {
14890
- Float32Array.prototype.set.call(receiver, source, offset);
14891
- return void 0;
14892
- }
14893
- checkFloat32Allocation(length2, budget);
14894
- const copied = new Float32Array(length2);
14895
- for (let index = 0; index < length2; index += 1) {
14896
- budget.visitNode();
14897
- const entry = Object.getOwnPropertyDescriptor(source, index);
14898
- if (entry !== void 0 && !("value" in entry))
14899
- throw new TypeError("Float32Array input accessors are not supported.");
14900
- copied[index] = float32Number(entry?.value);
14901
- }
14902
- Float32Array.prototype.set.call(receiver, copied, offset);
14903
- return void 0;
14881
+ return (async () => {
14882
+ const [source, offsetValue = 0] = args;
14883
+ const bridge = {
14884
+ ...context,
14885
+ stack: context?.stack ?? [],
14886
+ thisValue: receiver,
14887
+ getProperty: context?.getProperty ?? ((value2, property2) => {
14888
+ const descriptor2 = getSandboxPropertyDescriptor(value2, property2, budget);
14889
+ return descriptor2 === void 0 ? getSandboxDataProperty(value2, property2, budget) : readPropertyDescriptor(descriptor2, value2, bridge);
14890
+ }),
14891
+ invokeClosure: context?.invokeClosure ?? ((callee, values, thisValue, construct) => invokeBuiltinClosure(callee, values, budget, context, thisValue, construct))
14892
+ };
14893
+ let current;
14894
+ let sourceObject;
14895
+ const release = retainValues(budget, () => [receiver, sourceObject, current, ...args]);
14896
+ try {
14897
+ const number = await sandboxNumber(offsetValue, budget, bridge);
14898
+ const offset = Number.isNaN(number) ? 0 : Math.trunc(number);
14899
+ if (offset < 0) throw new RangeError("Float32Array#set offset is out of bounds.");
14900
+ if (source === null || source === void 0) throw new TypeError("Float32Array#set requires a non-null source.");
14901
+ let length2;
14902
+ if (isFloat32Array(source)) length2 = float32Storage(source).length;
14903
+ else {
14904
+ sourceObject = typeof source === "object" ? source : createSandboxBox(source);
14905
+ current = await bridge.getProperty(sourceObject, "length");
14906
+ const size = await sandboxNumber(current, budget, bridge);
14907
+ length2 = Number.isNaN(size) || size <= 0 ? 0 : Math.min(Math.trunc(size), Number.MAX_SAFE_INTEGER);
14908
+ }
14909
+ if (offset + length2 > storage2.length) throw new RangeError("Float32Array#set source is out of bounds.");
14910
+ if (isFloat32Array(source)) Float32Array.prototype.set.call(receiver, source, offset);
14911
+ else for (let index = 0; index < length2; index++) {
14912
+ budget.visitNode();
14913
+ current = await bridge.getProperty(sourceObject, String(index));
14914
+ receiver[offset + index] = await sandboxNumber(current, budget, bridge);
14915
+ }
14916
+ return void 0;
14917
+ } finally {
14918
+ release();
14919
+ }
14920
+ })();
14904
14921
  }
14905
14922
  const start = relativeIndex(args[0], storage2.length, 0);
14906
14923
  const end = relativeIndex(args[1], storage2.length, storage2.length);
@@ -41792,4 +41809,4 @@ export {
41792
41809
  FileSnapshotBackend,
41793
41810
  run
41794
41811
  };
41795
- //# sourceMappingURL=chunk-UKPTA2FY.js.map
41812
+ //# sourceMappingURL=chunk-HUG5DIKM.js.map