@poe-platform/safe-js 0.1.247 → 0.1.248
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-TL2QKHPX.js → chunk-FAZ46PGV.js} +29 -3
- package/dist/safe-js/chunks/{chunk-TL2QKHPX.js.map → chunk-FAZ46PGV.js.map} +2 -2
- package/dist/safe-js/chunks/{chunk-7ZMFUFNG.js → chunk-HTFX2QV6.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-7ZMFUFNG.js.map → chunk-HTFX2QV6.js.map} +0 -0
|
@@ -12551,12 +12551,12 @@ function createObjectArrayGlobals(options) {
|
|
|
12551
12551
|
}),
|
|
12552
12552
|
fromCharCode: createSandboxClosure({
|
|
12553
12553
|
sandbox: true,
|
|
12554
|
-
call: (args) =>
|
|
12554
|
+
call: (args, context) => stringFromCodes(args, String.fromCharCode, options.budget, context),
|
|
12555
12555
|
name: "fromCharCode"
|
|
12556
12556
|
}),
|
|
12557
12557
|
fromCodePoint: createSandboxClosure({
|
|
12558
12558
|
sandbox: true,
|
|
12559
|
-
call: (args) =>
|
|
12559
|
+
call: (args, context) => stringFromCodes(args, String.fromCodePoint, options.budget, context),
|
|
12560
12560
|
name: "fromCodePoint"
|
|
12561
12561
|
})
|
|
12562
12562
|
}
|
|
@@ -12948,6 +12948,32 @@ function budgetSandboxValue2(value, budget) {
|
|
|
12948
12948
|
const sandboxValue = deepCopyToSandbox(value);
|
|
12949
12949
|
return allocateProducedSandboxValue(sandboxValue, budget);
|
|
12950
12950
|
}
|
|
12951
|
+
function stringFromCodes(args, convert, budget, context) {
|
|
12952
|
+
let result = "";
|
|
12953
|
+
let index = 0;
|
|
12954
|
+
const release = retainValues(budget, () => [...args, result]);
|
|
12955
|
+
try {
|
|
12956
|
+
const output = advance();
|
|
12957
|
+
if (typeof output !== "string") return output.finally(release);
|
|
12958
|
+
release();
|
|
12959
|
+
return output;
|
|
12960
|
+
} catch (error) {
|
|
12961
|
+
release();
|
|
12962
|
+
throw error;
|
|
12963
|
+
}
|
|
12964
|
+
function advance() {
|
|
12965
|
+
while (index < args.length) {
|
|
12966
|
+
budget.visitNode();
|
|
12967
|
+
const number = sandboxNumber(args[index++], budget, context);
|
|
12968
|
+
if (number instanceof Promise) return number.then((value) => {
|
|
12969
|
+
result = budget.allocateString(result + convert(value));
|
|
12970
|
+
return advance();
|
|
12971
|
+
});
|
|
12972
|
+
result = budget.allocateString(result + convert(number));
|
|
12973
|
+
}
|
|
12974
|
+
return result;
|
|
12975
|
+
}
|
|
12976
|
+
}
|
|
12951
12977
|
function stringRaw(args, budget, context) {
|
|
12952
12978
|
const [template, ...substitutions] = args;
|
|
12953
12979
|
if (context?.getProperty !== void 0)
|
|
@@ -39521,4 +39547,4 @@ export {
|
|
|
39521
39547
|
FileSnapshotBackend,
|
|
39522
39548
|
run
|
|
39523
39549
|
};
|
|
39524
|
-
//# sourceMappingURL=chunk-
|
|
39550
|
+
//# sourceMappingURL=chunk-FAZ46PGV.js.map
|