@poe-platform/safe-js 0.1.323 → 0.1.325
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-XWFNWZEL.js → chunk-6YOMKQ6K.js} +53 -5
- package/dist/safe-js/chunks/{chunk-XWFNWZEL.js.map → chunk-6YOMKQ6K.js.map} +2 -2
- package/dist/safe-js/chunks/{chunk-JLGN75VU.js → chunk-ST4FPJYN.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-JLGN75VU.js.map → chunk-ST4FPJYN.js.map} +0 -0
|
@@ -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"])
|
|
14886
|
+
for (const key of ["set", "slice", "subarray", "fill", "copyWithin"])
|
|
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,17 +14965,17 @@ 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"].includes(key)) return void 0;
|
|
14968
|
+
if (!["set", "slice", "subarray", "fill", "copyWithin"].includes(key)) return void 0;
|
|
14969
14969
|
return createSandboxClosure({
|
|
14970
14970
|
guest: true,
|
|
14971
14971
|
sandbox: true,
|
|
14972
14972
|
name: key,
|
|
14973
|
-
length: key === "set" ? 1 : 2,
|
|
14973
|
+
length: key === "set" || key === "fill" ? 1 : 2,
|
|
14974
14974
|
call: (args, context) => {
|
|
14975
14975
|
const receiver = context?.thisValue;
|
|
14976
14976
|
if (!isFloat32Array(receiver))
|
|
14977
14977
|
throw new TypeError(`Float32Array#${key} requires a Float32Array receiver.`);
|
|
14978
|
-
const storage2 = float32Storage(receiver, key === "slice");
|
|
14978
|
+
const storage2 = float32Storage(receiver, key === "slice" || key === "fill" || key === "copyWithin");
|
|
14979
14979
|
const bridge = {
|
|
14980
14980
|
...context,
|
|
14981
14981
|
stack: context?.stack ?? [],
|
|
@@ -14986,6 +14986,54 @@ function getFloat32Member(value, property, budget, defaultConstructor) {
|
|
|
14986
14986
|
}),
|
|
14987
14987
|
invokeClosure: context?.invokeClosure ?? ((callee, values, thisValue, construct) => invokeBuiltinClosure(callee, values, budget, context, thisValue, construct))
|
|
14988
14988
|
};
|
|
14989
|
+
if (key === "copyWithin") {
|
|
14990
|
+
return (async () => {
|
|
14991
|
+
const release = retainValues(budget, () => [receiver, ...args]);
|
|
14992
|
+
try {
|
|
14993
|
+
const target = relativeIndex(await sandboxNumber(args[0], budget, bridge), storage2.length);
|
|
14994
|
+
const start = relativeIndex(await sandboxNumber(args[1], budget, bridge), storage2.length);
|
|
14995
|
+
const end = args[2] === void 0 ? storage2.length : relativeIndex(await sandboxNumber(args[2], budget, bridge), storage2.length);
|
|
14996
|
+
let count = Math.min(end - start, storage2.length - target);
|
|
14997
|
+
if (count > 0) {
|
|
14998
|
+
const current = float32Storage(receiver, true);
|
|
14999
|
+
count = Math.min(count, current.length - start, current.length - target);
|
|
15000
|
+
if (count > 0) {
|
|
15001
|
+
const bytes = new Uint8Array(current.buffer, current.byteOffset, current.length * 4);
|
|
15002
|
+
const direction = start < target && target < start + count ? -1 : 1;
|
|
15003
|
+
let from = start * 4 + (direction < 0 ? count * 4 - 1 : 0);
|
|
15004
|
+
let to = target * 4 + (direction < 0 ? count * 4 - 1 : 0);
|
|
15005
|
+
for (let remaining = count * 4; remaining > 0; remaining--) {
|
|
15006
|
+
budget.visitNode();
|
|
15007
|
+
bytes[to] = bytes[from];
|
|
15008
|
+
from += direction;
|
|
15009
|
+
to += direction;
|
|
15010
|
+
}
|
|
15011
|
+
}
|
|
15012
|
+
}
|
|
15013
|
+
return receiver;
|
|
15014
|
+
} finally {
|
|
15015
|
+
release();
|
|
15016
|
+
}
|
|
15017
|
+
})();
|
|
15018
|
+
}
|
|
15019
|
+
if (key === "fill") {
|
|
15020
|
+
return (async () => {
|
|
15021
|
+
const release = retainValues(budget, () => [receiver, ...args]);
|
|
15022
|
+
try {
|
|
15023
|
+
const value2 = await sandboxNumber(args[0], budget, bridge);
|
|
15024
|
+
const start = relativeIndex(await sandboxNumber(args[1], budget, bridge), storage2.length);
|
|
15025
|
+
const end = args[2] === void 0 ? storage2.length : relativeIndex(await sandboxNumber(args[2], budget, bridge), storage2.length);
|
|
15026
|
+
const current = float32Storage(receiver, true);
|
|
15027
|
+
for (let index = start; index < Math.min(end, current.length); index++) {
|
|
15028
|
+
budget.visitNode();
|
|
15029
|
+
receiver[index] = value2;
|
|
15030
|
+
}
|
|
15031
|
+
return receiver;
|
|
15032
|
+
} finally {
|
|
15033
|
+
release();
|
|
15034
|
+
}
|
|
15035
|
+
})();
|
|
15036
|
+
}
|
|
14989
15037
|
if (key === "set") {
|
|
14990
15038
|
return (async () => {
|
|
14991
15039
|
const [source, offsetValue = 0] = args;
|
|
@@ -42346,4 +42394,4 @@ export {
|
|
|
42346
42394
|
FileSnapshotBackend,
|
|
42347
42395
|
run
|
|
42348
42396
|
};
|
|
42349
|
-
//# sourceMappingURL=chunk-
|
|
42397
|
+
//# sourceMappingURL=chunk-6YOMKQ6K.js.map
|