@poe-platform/safe-js 0.1.304 → 0.1.305
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-I3JCUPXR.js → chunk-JIC2DHRN.js} +23 -11
- package/dist/safe-js/chunks/{chunk-I3JCUPXR.js.map → chunk-JIC2DHRN.js.map} +3 -3
- package/dist/safe-js/chunks/{chunk-K2TSSLLI.js → chunk-OENI52IW.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-K2TSSLLI.js.map → chunk-OENI52IW.js.map} +0 -0
|
@@ -14195,25 +14195,37 @@ function callFunctionMethod(target, methodName, args, options, stack, context) {
|
|
|
14195
14195
|
if (applyArgs === null || applyArgs === void 0) {
|
|
14196
14196
|
return options.callClosure(target, [], stack, thisValue);
|
|
14197
14197
|
}
|
|
14198
|
-
if (
|
|
14199
|
-
throw new TypeError("Function#apply requires an
|
|
14198
|
+
if (typeof applyArgs !== "object") {
|
|
14199
|
+
throw new TypeError("Function#apply requires an object or nullish arguments value.");
|
|
14200
14200
|
}
|
|
14201
|
-
if (context?.getProperty === void 0)
|
|
14201
|
+
if (context?.getProperty === void 0 && Array.isArray(applyArgs))
|
|
14202
14202
|
return options.callClosure(target, applyArgs, stack, thisValue);
|
|
14203
14203
|
return (async () => {
|
|
14204
|
+
const budget = options.budget ?? new Budget();
|
|
14205
|
+
const invocationContext = {
|
|
14206
|
+
...context,
|
|
14207
|
+
stack,
|
|
14208
|
+
thisValue: context?.thisValue,
|
|
14209
|
+
invokeClosure: context?.invokeClosure ?? ((callee, values2, receiver) => Promise.resolve(options.callClosure(callee, values2, stack, receiver)))
|
|
14210
|
+
};
|
|
14211
|
+
const read = (value, key) => {
|
|
14212
|
+
if (context?.getProperty !== void 0) return context.getProperty(value, key);
|
|
14213
|
+
const descriptor = getSandboxPropertyDescriptor(value, key, budget);
|
|
14214
|
+
return descriptor === void 0 ? void 0 : readPropertyDescriptor(descriptor, value, invocationContext);
|
|
14215
|
+
};
|
|
14204
14216
|
const values = [];
|
|
14205
|
-
const
|
|
14206
|
-
options.budget?.allocateArrayLength(length);
|
|
14207
|
-
const retained = {};
|
|
14208
|
-
options.budget?.setRetainedValues(retained, () => values);
|
|
14217
|
+
const release = retainValues(budget, () => [applyArgs, ...values]);
|
|
14209
14218
|
try {
|
|
14219
|
+
const number = await sandboxNumber(await read(applyArgs, "length"), budget, invocationContext);
|
|
14220
|
+
const length = Number.isNaN(number) || number <= 0 ? 0 : Math.min(Math.trunc(number), Number.MAX_SAFE_INTEGER);
|
|
14221
|
+
budget.allocateArrayLength(length);
|
|
14210
14222
|
for (let index = 0; index < length; index++) {
|
|
14211
|
-
|
|
14212
|
-
values.push(await
|
|
14223
|
+
budget.visitNode();
|
|
14224
|
+
values.push(await read(applyArgs, String(index)));
|
|
14213
14225
|
}
|
|
14214
14226
|
return await options.callClosure(target, values, stack, thisValue);
|
|
14215
14227
|
} finally {
|
|
14216
|
-
|
|
14228
|
+
release();
|
|
14217
14229
|
}
|
|
14218
14230
|
})();
|
|
14219
14231
|
}
|
|
@@ -41239,4 +41251,4 @@ export {
|
|
|
41239
41251
|
FileSnapshotBackend,
|
|
41240
41252
|
run
|
|
41241
41253
|
};
|
|
41242
|
-
//# sourceMappingURL=chunk-
|
|
41254
|
+
//# sourceMappingURL=chunk-JIC2DHRN.js.map
|