@poe-platform/safe-js 0.1.341 → 0.1.343
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-ELLV4F7X.js → chunk-B4T2KNMY.js} +52 -11
- package/dist/safe-js/chunks/{chunk-ELLV4F7X.js.map → chunk-B4T2KNMY.js.map} +2 -2
- package/dist/safe-js/chunks/{chunk-OTYARHSW.js → chunk-F325RI2Y.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-OTYARHSW.js.map → chunk-F325RI2Y.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", "fill", "copyWithin", "reverse", "at", "includes", "indexOf", "lastIndexOf", "forEach", "every", "some", "find", "findIndex", "findLast", "findLastIndex", "map", "toLocaleString"])
|
|
14886
|
+
for (const key of ["set", "slice", "subarray", "fill", "copyWithin", "reverse", "at", "includes", "indexOf", "lastIndexOf", "forEach", "every", "some", "find", "findIndex", "findLast", "findLastIndex", "reduce", "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,18 @@ 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", "map", "toLocaleString"].includes(key)) return void 0;
|
|
14968
|
+
if (!["set", "slice", "subarray", "fill", "copyWithin", "reverse", "at", "includes", "indexOf", "lastIndexOf", "forEach", "every", "some", "find", "findIndex", "findLast", "findLastIndex", "reduce", "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 === "map" || 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 === "toLocaleString" ? 0 : key === "reduce" || 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
14976
|
const receiver = context?.thisValue;
|
|
14977
14977
|
if (!isFloat32Array(receiver))
|
|
14978
14978
|
throw new TypeError(`Float32Array#${key} requires a Float32Array receiver.`);
|
|
14979
|
-
const storage2 = float32Storage(receiver, key === "map" || 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");
|
|
14979
|
+
const storage2 = float32Storage(receiver, key === "reduce" || 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");
|
|
14980
14980
|
if (key === "reverse") {
|
|
14981
14981
|
const release = retainValues(budget, () => [receiver, ...args]);
|
|
14982
14982
|
try {
|
|
@@ -15029,6 +15029,25 @@ function getFloat32Member(value, property, budget, defaultConstructor) {
|
|
|
15029
15029
|
}
|
|
15030
15030
|
})();
|
|
15031
15031
|
}
|
|
15032
|
+
if (key === "reduce") {
|
|
15033
|
+
const callback2 = args[0];
|
|
15034
|
+
if (!isSandboxClosure(callback2)) throw new TypeError("Float32Array#reduce callback must be callable.");
|
|
15035
|
+
const hasInitialValue = args.length > 1;
|
|
15036
|
+
if (!hasInitialValue && storage2.length === 0) throw new TypeError("Reduce of empty typed array with no initial value.");
|
|
15037
|
+
let accumulator = hasInitialValue ? args[1] : receiver[0];
|
|
15038
|
+
return (async () => {
|
|
15039
|
+
const release = retainValues(budget, () => [receiver, accumulator, ...args]);
|
|
15040
|
+
try {
|
|
15041
|
+
for (let index = hasInitialValue ? 0 : 1; index < storage2.length; index++) {
|
|
15042
|
+
budget.visitNode();
|
|
15043
|
+
accumulator = await invokeBuiltinClosure(callback2, [accumulator, receiver[index], index, receiver], budget, bridge, void 0);
|
|
15044
|
+
}
|
|
15045
|
+
return accumulator;
|
|
15046
|
+
} finally {
|
|
15047
|
+
release();
|
|
15048
|
+
}
|
|
15049
|
+
})();
|
|
15050
|
+
}
|
|
15032
15051
|
if (key === "forEach" || key === "every" || key === "some" || key === "find" || key === "findIndex" || key === "findLast" || key === "findLastIndex") {
|
|
15033
15052
|
const callback2 = args[0];
|
|
15034
15053
|
if (!isSandboxClosure(callback2)) throw new TypeError(`Float32Array#${key} callback must be callable.`);
|
|
@@ -15171,17 +15190,32 @@ function getFloat32Member(value, property, budget, defaultConstructor) {
|
|
|
15171
15190
|
}
|
|
15172
15191
|
})();
|
|
15173
15192
|
}
|
|
15174
|
-
const callback = key === "map" ? args[0] : void 0;
|
|
15175
|
-
if (key === "map" && !isSandboxClosure(callback)) throw new TypeError(
|
|
15193
|
+
const callback = key === "map" || key === "filter" ? args[0] : void 0;
|
|
15194
|
+
if ((key === "map" || key === "filter") && !isSandboxClosure(callback)) throw new TypeError(`Float32Array#${key} callback must be callable.`);
|
|
15176
15195
|
return (async () => {
|
|
15177
15196
|
let candidate;
|
|
15178
15197
|
let result;
|
|
15179
15198
|
let mapped;
|
|
15180
|
-
const
|
|
15199
|
+
const kept = [];
|
|
15200
|
+
const release = retainValues(budget, () => [receiver, candidate, result, mapped, kept, ...args]);
|
|
15181
15201
|
try {
|
|
15182
|
-
const start = key === "map" ? 0 : relativeIndex(await sandboxNumber(args[0], budget, bridge), storage2.length);
|
|
15183
|
-
const end = key === "map" || args[1] === void 0 ? storage2.length : relativeIndex(await sandboxNumber(args[1], budget, bridge), storage2.length);
|
|
15184
|
-
|
|
15202
|
+
const start = key === "map" || key === "filter" ? 0 : relativeIndex(await sandboxNumber(args[0], budget, bridge), storage2.length);
|
|
15203
|
+
const end = key === "map" || key === "filter" || args[1] === void 0 ? storage2.length : relativeIndex(await sandboxNumber(args[1], budget, bridge), storage2.length);
|
|
15204
|
+
let length = Math.max(end - start, 0);
|
|
15205
|
+
if (key === "filter") {
|
|
15206
|
+
const checkData = createDataCheckpoint(budget, bridge);
|
|
15207
|
+
for (let index = 0; index < length; index++) {
|
|
15208
|
+
budget.visitNode();
|
|
15209
|
+
const element = receiver[index];
|
|
15210
|
+
const selected = await invokeBuiltinClosure(callback, [element, index, receiver], budget, bridge, args[1]);
|
|
15211
|
+
if (selected) {
|
|
15212
|
+
budget.allocateArrayLength(kept.length + 1);
|
|
15213
|
+
kept.push(element);
|
|
15214
|
+
checkData(kept, 1 + (budget.limits.dataSize === void 0 ? 0 : measureSandboxData([element])));
|
|
15215
|
+
}
|
|
15216
|
+
}
|
|
15217
|
+
length = kept.length;
|
|
15218
|
+
}
|
|
15185
15219
|
const layout = float32ViewLayouts.get(receiver);
|
|
15186
15220
|
const offset = (layout?.byteOffset ?? storage2.byteOffset) + start * 4;
|
|
15187
15221
|
const tracking = layout !== void 0 && layout.length === void 0 && args[1] === void 0;
|
|
@@ -15216,6 +15250,13 @@ function getFloat32Member(value, property, budget, defaultConstructor) {
|
|
|
15216
15250
|
result = new Float32Array(length);
|
|
15217
15251
|
}
|
|
15218
15252
|
if (!isFloat32Array(result)) throw new TypeError("TypedArray species must return typed storage.");
|
|
15253
|
+
if (key === "filter") {
|
|
15254
|
+
for (let index = 0; index < length; index++) {
|
|
15255
|
+
budget.visitNode();
|
|
15256
|
+
result[index] = kept[index] ?? NaN;
|
|
15257
|
+
}
|
|
15258
|
+
return result;
|
|
15259
|
+
}
|
|
15219
15260
|
if (key === "map") {
|
|
15220
15261
|
for (let index = 0; index < length; index++) {
|
|
15221
15262
|
budget.visitNode();
|
|
@@ -42511,4 +42552,4 @@ export {
|
|
|
42511
42552
|
FileSnapshotBackend,
|
|
42512
42553
|
run
|
|
42513
42554
|
};
|
|
42514
|
-
//# sourceMappingURL=chunk-
|
|
42555
|
+
//# sourceMappingURL=chunk-B4T2KNMY.js.map
|