@poe-platform/safe-js 0.1.473 → 0.1.475

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.
@@ -10321,21 +10321,19 @@ function createObjectGlobal(methods3, budget) {
10321
10321
  sandbox: true,
10322
10322
  name: "hasOwnProperty",
10323
10323
  length: 1,
10324
- call: async ([key], context) => hasOwnSandboxProperty(
10325
- requireReceiver(context?.thisValue),
10326
- await toPropertyKey(key, budget, context),
10327
- false
10328
- )
10324
+ call: async ([key], context) => {
10325
+ const property = await toPropertyKey(key, budget, context);
10326
+ return hasOwnSandboxProperty(context?.thisValue, property, false);
10327
+ }
10329
10328
  }),
10330
10329
  propertyIsEnumerable: createSandboxClosure({
10331
10330
  sandbox: true,
10332
10331
  name: "propertyIsEnumerable",
10333
10332
  length: 1,
10334
- call: async ([key], context) => hasOwnSandboxProperty(
10335
- requireReceiver(context?.thisValue),
10336
- await toPropertyKey(key, budget, context),
10337
- true
10338
- )
10333
+ call: async ([key], context) => {
10334
+ const property = await toPropertyKey(key, budget, context);
10335
+ return hasOwnSandboxProperty(context?.thisValue, property, true);
10336
+ }
10339
10337
  }),
10340
10338
  isPrototypeOf: createSandboxClosure({
10341
10339
  sandbox: true,
@@ -31819,6 +31817,45 @@ function createRegexGlobals(options) {
31819
31817
  configurable: true
31820
31818
  });
31821
31819
  const prototype = createIntrinsicObject();
31820
+ Object.defineProperty(prototype, "compile", {
31821
+ value: createSandboxClosure({
31822
+ guest: true,
31823
+ sandbox: true,
31824
+ name: "compile",
31825
+ length: 2,
31826
+ call: async ([pattern, flags], context) => {
31827
+ const receiver = context?.thisValue;
31828
+ if (!isSandboxRegex(receiver)) throw new TypeError("RegExp.compile requires a regex receiver.");
31829
+ if (isSandboxRegex(pattern) && flags !== void 0) throw new TypeError("Cannot supply flags with a RegExp pattern.");
31830
+ const selected = options.compileOwner ?? context?.compilation?.owner;
31831
+ if (context?.compilation?.owner !== void 0 && selected !== context.compilation.owner) throw new SandboxError("reentry");
31832
+ const operation = options.budget.acquireCompileOwner(false, selected);
31833
+ const compilation = context?.compilation?.owner === operation.owner ? context.compilation : new CompileScope(operation.owner);
31834
+ let source = "";
31835
+ const release = retainValues(options.budget, () => [receiver, pattern, flags, source]);
31836
+ try {
31837
+ if (isSandboxRegex(pattern)) {
31838
+ flags = pattern.flags;
31839
+ pattern = pattern.source;
31840
+ }
31841
+ source = pattern === void 0 ? "" : await sandboxString(pattern, options.budget, context);
31842
+ const flagText = flags === void 0 ? "" : await sandboxString(flags, options.budget, context);
31843
+ recompileSandboxRegex(receiver, source, flagText, compilation);
31844
+ return receiver;
31845
+ } finally {
31846
+ release();
31847
+ try {
31848
+ if (compilation !== context?.compilation) reconcileCompiledValues(options.budget, [receiver], compilation);
31849
+ } finally {
31850
+ if (compilation !== context?.compilation) compilation.dispose();
31851
+ operation.release();
31852
+ }
31853
+ }
31854
+ }
31855
+ }),
31856
+ writable: true,
31857
+ configurable: true
31858
+ });
31822
31859
  Object.defineProperty(materializeFunctionProperties(constructor), Symbol.species, {
31823
31860
  get: accessorAdapter(createSandboxClosure({
31824
31861
  sandbox: true,
@@ -38833,13 +38870,22 @@ function createSandboxRegex(source, flags = "", lastIndex = 0, compilation) {
38833
38870
  regexGuestProperties.set(regex, properties);
38834
38871
  Object.defineProperties(regex, {
38835
38872
  [sandboxRegexBrand]: { value: true },
38836
- [sandboxRegexPattern]: { value: pattern }
38873
+ [sandboxRegexPattern]: { value: pattern, writable: true }
38837
38874
  });
38838
38875
  return Object.seal(regex);
38839
38876
  }
38840
38877
  function getSandboxRegexPattern(regex) {
38841
38878
  return regex[sandboxRegexPattern];
38842
38879
  }
38880
+ function recompileSandboxRegex(regex, source, flags, compilation) {
38881
+ const pattern = parseRegex(source, flags, compilation, 7 + source.length + flags.length);
38882
+ Object.defineProperties(regex, {
38883
+ source: { value: source },
38884
+ flags: { value: flags },
38885
+ [sandboxRegexPattern]: { value: pattern }
38886
+ });
38887
+ regex.lastIndex = 0;
38888
+ }
38843
38889
  function isSandboxClosure(value) {
38844
38890
  return typeof value === "object" && value !== null && sandboxClosureBrand in value;
38845
38891
  }
@@ -57145,4 +57191,4 @@ authorization of the copyright holder.
57145
57191
  SPDX-License-Identifier: Unicode-3.0
57146
57192
 
57147
57193
  */
57148
- //# sourceMappingURL=chunk-LXNXNWYD.js.map
57194
+ //# sourceMappingURL=chunk-PAFO5N4X.js.map