@poe-platform/safe-js 0.1.167 → 0.1.168

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.
@@ -10935,6 +10935,36 @@ function createObjectArrayGlobals(options) {
10935
10935
  },
10936
10936
  name: "fromEntries"
10937
10937
  }),
10938
+ preventExtensions: createSandboxClosure({
10939
+ sandbox: true,
10940
+ call: ([value]) => {
10941
+ if (isGuestHostObject(value))
10942
+ throw new TypeError("Live host objects cannot be made non-extensible.");
10943
+ Object.preventExtensions(isGuestClosure(value) ? materializeFunctionProperties(value) : value);
10944
+ return value;
10945
+ },
10946
+ name: "preventExtensions"
10947
+ }),
10948
+ isExtensible: createSandboxClosure({
10949
+ sandbox: true,
10950
+ call: ([value]) => Object.isExtensible(isGuestClosure(value) ? materializeFunctionProperties(value) : value),
10951
+ name: "isExtensible"
10952
+ }),
10953
+ seal: createSandboxClosure({
10954
+ sandbox: true,
10955
+ call: ([value]) => {
10956
+ if (isGuestHostObject(value))
10957
+ throw new TypeError("Live host objects cannot be sealed.");
10958
+ Object.seal(isGuestClosure(value) ? materializeFunctionProperties(value) : value);
10959
+ return value;
10960
+ },
10961
+ name: "seal"
10962
+ }),
10963
+ isSealed: createSandboxClosure({
10964
+ sandbox: true,
10965
+ call: ([value]) => Object.isSealed(isGuestClosure(value) ? materializeFunctionProperties(value) : value),
10966
+ name: "isSealed"
10967
+ }),
10938
10968
  freeze: createSandboxClosure({
10939
10969
  sandbox: true,
10940
10970
  call: ([value]) => {
@@ -11914,19 +11944,25 @@ async function callArrayMethodUnlocked(value, methodName, args, options, stack)
11914
11944
  options.budget.setRetainedValues(retained, () => [result]);
11915
11945
  try {
11916
11946
  for (const entry of [value, ...args]) {
11917
- if (!Array.isArray(entry)) {
11947
+ let spread = false;
11948
+ if (entry !== null && (typeof entry === "object" || typeof entry === "function")) {
11949
+ const flag = options.context?.getProperty !== void 0 ? await options.context.getProperty(entry, Symbol.isConcatSpreadable) : getSandboxDataProperty(entry, Symbol.isConcatSpreadable, options.budget);
11950
+ spread = flag === void 0 ? Array.isArray(entry) : Boolean(flag);
11951
+ }
11952
+ if (!spread) {
11918
11953
  options.budget.allocateArrayLength(result.length + 1);
11919
11954
  result.push(entry);
11920
11955
  continue;
11921
11956
  }
11922
11957
  const start = result.length;
11923
- const length = entry.length;
11958
+ const source = await arrayLikeView(entry, options);
11959
+ const length = source.length;
11924
11960
  options.budget.allocateArrayLength(start + length);
11925
11961
  result.length += length;
11926
11962
  for (let index = 0; index < length; index++) {
11927
11963
  options.budget.visitNode();
11928
- if (index in entry)
11929
- result[start + index] = await readArrayElement(entry, index, options);
11964
+ if (index in source)
11965
+ result[start + index] = await readArrayElement(source, index, options);
11930
11966
  }
11931
11967
  }
11932
11968
  return budgetProducedValue(result, options.budget);
@@ -35937,4 +35973,4 @@ export {
35937
35973
  FileSnapshotBackend,
35938
35974
  run
35939
35975
  };
35940
- //# sourceMappingURL=chunk-QQ2J2CDJ.js.map
35976
+ //# sourceMappingURL=chunk-6QBK7Y47.js.map