@poe-platform/safe-js 0.1.312 → 0.1.314
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.
- package/dist/safe-js/chunks/{chunk-UKPTA2FY.js → chunk-PT7PBLVT.js} +60 -38
- package/dist/safe-js/chunks/{chunk-UKPTA2FY.js.map → chunk-PT7PBLVT.js.map} +3 -3
- package/dist/safe-js/chunks/{chunk-DXPIMJKO.js → chunk-T7FA2SBH.js} +2 -2
- package/dist/safe-js/cli.js +2 -2
- package/dist/safe-js/core.js +1 -1
- package/dist/safe-js/index.js +2 -2
- package/package.json +2 -2
- /package/dist/safe-js/chunks/{chunk-DXPIMJKO.js.map → chunk-T7FA2SBH.js.map} +0 -0
|
@@ -14877,42 +14877,66 @@ function getFloat32Member(value, property, budget) {
|
|
|
14877
14877
|
if (!isFloat32Array(receiver))
|
|
14878
14878
|
throw new TypeError(`Float32Array#${key} requires a Float32Array receiver.`);
|
|
14879
14879
|
const storage2 = float32Storage(receiver);
|
|
14880
|
+
const bridge = {
|
|
14881
|
+
...context,
|
|
14882
|
+
stack: context?.stack ?? [],
|
|
14883
|
+
thisValue: receiver,
|
|
14884
|
+
getProperty: context?.getProperty ?? ((value2, property2) => {
|
|
14885
|
+
const descriptor2 = getSandboxPropertyDescriptor(value2, property2, budget);
|
|
14886
|
+
return descriptor2 === void 0 ? getSandboxDataProperty(value2, property2, budget) : readPropertyDescriptor(descriptor2, value2, bridge);
|
|
14887
|
+
}),
|
|
14888
|
+
invokeClosure: context?.invokeClosure ?? ((callee, values, thisValue, construct) => invokeBuiltinClosure(callee, values, budget, context, thisValue, construct))
|
|
14889
|
+
};
|
|
14880
14890
|
if (key === "set") {
|
|
14881
|
-
|
|
14882
|
-
|
|
14883
|
-
|
|
14884
|
-
|
|
14885
|
-
|
|
14886
|
-
|
|
14887
|
-
|
|
14888
|
-
|
|
14889
|
-
|
|
14890
|
-
|
|
14891
|
-
|
|
14892
|
-
|
|
14893
|
-
|
|
14894
|
-
|
|
14895
|
-
|
|
14896
|
-
|
|
14897
|
-
|
|
14898
|
-
|
|
14899
|
-
throw new
|
|
14900
|
-
|
|
14901
|
-
|
|
14902
|
-
|
|
14903
|
-
|
|
14891
|
+
return (async () => {
|
|
14892
|
+
const [source, offsetValue = 0] = args;
|
|
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 length;
|
|
14902
|
+
if (isFloat32Array(source)) length = 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
|
+
length = Number.isNaN(size) || size <= 0 ? 0 : Math.min(Math.trunc(size), Number.MAX_SAFE_INTEGER);
|
|
14908
|
+
}
|
|
14909
|
+
if (offset + length > 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 < length; 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
|
-
|
|
14906
|
-
|
|
14907
|
-
|
|
14908
|
-
|
|
14909
|
-
|
|
14910
|
-
|
|
14911
|
-
|
|
14912
|
-
|
|
14913
|
-
|
|
14914
|
-
|
|
14915
|
-
|
|
14922
|
+
return (async () => {
|
|
14923
|
+
const release = retainValues(budget, () => [receiver, ...args]);
|
|
14924
|
+
try {
|
|
14925
|
+
const start = relativeIndex(await sandboxNumber(args[0], budget, bridge), storage2.length);
|
|
14926
|
+
const end = args[1] === void 0 ? storage2.length : relativeIndex(await sandboxNumber(args[1], budget, bridge), storage2.length);
|
|
14927
|
+
const length = Math.max(end - start, 0);
|
|
14928
|
+
if (key === "subarray")
|
|
14929
|
+
return new Float32Array(storage2.buffer, storage2.byteOffset + start * 4, length);
|
|
14930
|
+
checkFloat32Allocation(length, budget);
|
|
14931
|
+
const result = new Float32Array(length);
|
|
14932
|
+
new Uint8Array(result.buffer).set(
|
|
14933
|
+
new Uint8Array(storage2.buffer, storage2.byteOffset + start * 4, length * 4)
|
|
14934
|
+
);
|
|
14935
|
+
return result;
|
|
14936
|
+
} finally {
|
|
14937
|
+
release();
|
|
14938
|
+
}
|
|
14939
|
+
})();
|
|
14916
14940
|
}
|
|
14917
14941
|
});
|
|
14918
14942
|
}
|
|
@@ -14934,9 +14958,7 @@ function setFloat32Member(value, property, entry, budget) {
|
|
|
14934
14958
|
descriptor === void 0 ? { value: entry, configurable: true, enumerable: true, writable: true } : { value: entry }
|
|
14935
14959
|
);
|
|
14936
14960
|
}
|
|
14937
|
-
function relativeIndex(
|
|
14938
|
-
if (value === void 0) return fallback;
|
|
14939
|
-
const numeric = float32Number(value);
|
|
14961
|
+
function relativeIndex(numeric, length) {
|
|
14940
14962
|
const integer2 = Number.isNaN(numeric) ? 0 : Math.trunc(numeric);
|
|
14941
14963
|
return integer2 < 0 ? Math.max(length + integer2, 0) : Math.min(integer2, length);
|
|
14942
14964
|
}
|
|
@@ -41792,4 +41814,4 @@ export {
|
|
|
41792
41814
|
FileSnapshotBackend,
|
|
41793
41815
|
run
|
|
41794
41816
|
};
|
|
41795
|
-
//# sourceMappingURL=chunk-
|
|
41817
|
+
//# sourceMappingURL=chunk-PT7PBLVT.js.map
|