@poe-platform/safe-js 0.1.118 → 0.1.119
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-7FCWZM6I.js → chunk-6LFWVA64.js} +25 -14
- package/dist/safe-js/chunks/{chunk-7FCWZM6I.js.map → chunk-6LFWVA64.js.map} +2 -2
- package/dist/safe-js/chunks/{chunk-UPKTG5MR.js → chunk-IXR26PKW.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-UPKTG5MR.js.map → chunk-IXR26PKW.js.map} +0 -0
|
@@ -30612,32 +30612,43 @@ function defineDataProperty(target, key, value) {
|
|
|
30612
30612
|
}
|
|
30613
30613
|
|
|
30614
30614
|
// packages/safe-js/src/interp/globals/regex.ts
|
|
30615
|
-
function createRegexGlobals(
|
|
30616
|
-
const
|
|
30617
|
-
const selected =
|
|
30615
|
+
function createRegexGlobals(options) {
|
|
30616
|
+
const invoke = (construct) => async (args, context) => {
|
|
30617
|
+
const selected = options.compileOwner ?? context?.compilation?.owner;
|
|
30618
30618
|
if (context?.compilation?.owner !== void 0 && selected !== context.compilation.owner) {
|
|
30619
30619
|
throw new SandboxError("reentry");
|
|
30620
30620
|
}
|
|
30621
|
-
const operation =
|
|
30622
|
-
const compilation = context?.compilation
|
|
30621
|
+
const operation = options.budget.acquireCompileOwner(false, selected);
|
|
30622
|
+
const compilation = context?.compilation?.owner === operation.owner ? context.compilation : new CompileScope(operation.owner);
|
|
30623
|
+
let source = "";
|
|
30624
|
+
const retained = {};
|
|
30625
|
+
options.budget.setRetainedValues(retained, () => [...args, source]);
|
|
30623
30626
|
try {
|
|
30627
|
+
const pattern = args[0];
|
|
30628
|
+
const flags = args[1];
|
|
30629
|
+
if (!construct && isSandboxRegex(pattern) && flags === void 0) return pattern;
|
|
30630
|
+
const sourceValue = isSandboxRegex(pattern) ? pattern.source : pattern;
|
|
30631
|
+
const flagsValue = isSandboxRegex(pattern) && flags === void 0 ? pattern.flags : flags;
|
|
30632
|
+
source = sourceValue === void 0 ? "" : await sandboxString(sourceValue, options.budget, context);
|
|
30633
|
+
const flagText = flagsValue === void 0 ? "" : await sandboxString(flagsValue, options.budget, context);
|
|
30624
30634
|
const regex = createSandboxRegex(
|
|
30625
|
-
|
|
30626
|
-
|
|
30635
|
+
source,
|
|
30636
|
+
flagText,
|
|
30627
30637
|
0,
|
|
30628
30638
|
compilation
|
|
30629
30639
|
);
|
|
30630
|
-
if (
|
|
30631
|
-
reconcileCompiledValues(
|
|
30640
|
+
if (compilation !== context?.compilation) {
|
|
30641
|
+
reconcileCompiledValues(options.budget, [regex], compilation);
|
|
30632
30642
|
}
|
|
30633
30643
|
return regex;
|
|
30634
30644
|
} finally {
|
|
30635
|
-
|
|
30636
|
-
|
|
30645
|
+
options.budget.setRetainedValues(retained, void 0);
|
|
30646
|
+
if (compilation !== context?.compilation) compilation.dispose();
|
|
30647
|
+
operation.release();
|
|
30637
30648
|
}
|
|
30638
30649
|
};
|
|
30639
30650
|
return {
|
|
30640
|
-
RegExp: createSandboxClosure({ sandbox: true, name: "RegExp", call:
|
|
30651
|
+
RegExp: createSandboxClosure({ sandbox: true, name: "RegExp", call: invoke(false), construct: invoke(true) })
|
|
30641
30652
|
};
|
|
30642
30653
|
}
|
|
30643
30654
|
|
|
@@ -31194,7 +31205,7 @@ function createBuiltinBindings(options) {
|
|
|
31194
31205
|
...createObjectArrayGlobals(options),
|
|
31195
31206
|
...createMiscGlobals(options),
|
|
31196
31207
|
...createPromiseGlobals(options),
|
|
31197
|
-
...createRegexGlobals(options
|
|
31208
|
+
...createRegexGlobals(options)
|
|
31198
31209
|
};
|
|
31199
31210
|
}
|
|
31200
31211
|
|
|
@@ -33317,4 +33328,4 @@ export {
|
|
|
33317
33328
|
FileSnapshotBackend,
|
|
33318
33329
|
run
|
|
33319
33330
|
};
|
|
33320
|
-
//# sourceMappingURL=chunk-
|
|
33331
|
+
//# sourceMappingURL=chunk-6LFWVA64.js.map
|