@poe-platform/safe-js 0.1.266 → 0.1.268

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.
@@ -11737,10 +11737,14 @@ function createPromiseGlobals(options) {
11737
11737
  if (typeof constructor !== "object" || constructor === null) {
11738
11738
  throw new TypeError("Promise.resolve requires an object receiver.");
11739
11739
  }
11740
- if (isSandboxPromise(value) && getPromiseMember("constructor", options.budget) === constructor) {
11741
- return value;
11742
- }
11743
- return isSandboxPromiseConstructor(constructor) ? createSandboxPromise(resolveSandboxValue(value, { budget: options.budget })) : settleConstructedPromise(constructor, value, "fulfilled", options.budget, context);
11740
+ const finish = (actualConstructor2) => {
11741
+ if (isSandboxPromise(value) && actualConstructor2 === constructor) return value;
11742
+ return isSandboxPromiseConstructor(constructor) ? createSandboxPromise(resolveSandboxValue(value, { budget: options.budget })) : settleConstructedPromise(constructor, value, "fulfilled", options.budget, context);
11743
+ };
11744
+ if (!isSandboxPromise(value)) return finish(void 0);
11745
+ const descriptor = getSandboxPropertyDescriptor(value, "constructor", options.budget);
11746
+ const actualConstructor = descriptor === void 0 ? getPromiseMember("constructor", options.budget) : readPropertyDescriptor(descriptor, value, context, true);
11747
+ return actualConstructor instanceof Promise ? actualConstructor.then(finish) : finish(actualConstructor);
11744
11748
  },
11745
11749
  name: "resolve"
11746
11750
  }),
@@ -13940,8 +13944,13 @@ function assignSandboxValues(target, sources, budget, context) {
13940
13944
  if (context === void 0) {
13941
13945
  for (const source of sources) {
13942
13946
  if (source === null || source === void 0) continue;
13943
- for (const [key, value] of ownEnumerableSandboxEntries(source))
13947
+ const properties = isGuestHostObject(source) ? void 0 : reflectionProperties(source);
13948
+ const keys = properties === void 0 ? ownEnumerableSandboxKeys(source, true) : [...Object.getOwnPropertyNames(properties), ...ownSandboxSymbolKeys(source)];
13949
+ for (const key of keys) {
13950
+ if (!hasOwnSandboxProperty(source, key, true)) continue;
13951
+ const value = properties === void 0 ? getSandboxDataProperty(source, key, budget) : Reflect.get(properties, key, source);
13944
13952
  setSandboxProperty(target, key, value, budget);
13953
+ }
13945
13954
  }
13946
13955
  return target;
13947
13956
  }
@@ -13950,9 +13959,11 @@ function assignSandboxValues(target, sources, budget, context) {
13950
13959
  try {
13951
13960
  for (const source of sources) {
13952
13961
  if (source === null || source === void 0) continue;
13953
- for (const key of ownEnumerableSandboxKeys(source)) {
13962
+ const properties = isGuestHostObject(source) ? void 0 : reflectionProperties(source);
13963
+ const keys = properties === void 0 ? ownEnumerableSandboxKeys(source, true) : [...Object.getOwnPropertyNames(properties), ...ownSandboxSymbolKeys(source)];
13964
+ for (const key of keys) {
13954
13965
  if (!hasOwnSandboxProperty(source, key, true)) continue;
13955
- const value = await (context.getProperty !== void 0 ? context.getProperty(source, key) : getSandboxDataProperty(source, key, budget));
13966
+ const value = await (context?.getProperty !== void 0 ? context.getProperty(source, key) : isGuestHostObject(source) ? getSandboxDataProperty(source, key, budget) : readPropertyDescriptor(Object.getOwnPropertyDescriptor(properties, key), source, context, true));
13956
13967
  await setSandboxProperty(target, key, value, budget, true, context);
13957
13968
  }
13958
13969
  }
@@ -40082,4 +40093,4 @@ export {
40082
40093
  FileSnapshotBackend,
40083
40094
  run
40084
40095
  };
40085
- //# sourceMappingURL=chunk-2W5HRQU3.js.map
40096
+ //# sourceMappingURL=chunk-3BMZELFG.js.map