@poe-platform/safe-js 0.1.360 → 0.1.361

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.
@@ -27,7 +27,7 @@ import {
27
27
  validateMigrationSemantics,
28
28
  validateSnapshotData,
29
29
  validateSnapshotMigration
30
- } from "./chunk-RHEDM44A.js";
30
+ } from "./chunk-UPTA6E3T.js";
31
31
 
32
32
  // packages/safe-js/src/migrate.ts
33
33
  import { createHash } from "node:crypto";
@@ -8249,4 +8249,4 @@ export {
8249
8249
  parseMcpConfig,
8250
8250
  makeMcpModule
8251
8251
  };
8252
- //# sourceMappingURL=chunk-JFOSC26Y.js.map
8252
+ //# sourceMappingURL=chunk-MGIF45X7.js.map
@@ -19703,6 +19703,7 @@ function typeTag(value, builtinOnly = false) {
19703
19703
 
19704
19704
  // packages/safe-js/src/interp/exceptions.ts
19705
19705
  var capturedExceptionBrand = /* @__PURE__ */ Symbol("CapturedException");
19706
+ var readDOMExceptionCode = Object.getOwnPropertyDescriptor(DOMException.prototype, "code").get;
19706
19707
  internalSymbols.add(capturedExceptionBrand);
19707
19708
  async function evaluateThrowStatement(node, context, evaluateNode2) {
19708
19709
  const argument = await evaluateNode2(node.argument, context);
@@ -19815,11 +19816,14 @@ function coerceThrownValue(reason, budget, stackFrames, span, sandbox = false) {
19815
19816
  return reason;
19816
19817
  }
19817
19818
  if (reason instanceof Error) {
19818
- return createSubsetErrorValue(reason.name || "Error", reason.message, stackFrames, budget, {
19819
+ const error = createSubsetErrorValue(reason.name || "Error", reason.message, stackFrames, budget, {
19819
19820
  chargeBudget: false,
19820
19821
  cause: readErrorCause(reason),
19821
19822
  span
19822
19823
  });
19824
+ if (reason instanceof DOMException)
19825
+ Object.defineProperty(error, "code", { value: Reflect.apply(readDOMExceptionCode, reason, []), enumerable: true });
19826
+ return error;
19823
19827
  }
19824
19828
  if (sandbox) {
19825
19829
  return reason;
@@ -28135,6 +28139,14 @@ function copyToSandbox(value, state, path = "<root>", cloneSandboxCollections =
28135
28139
  if (isNumericTypedArray(value)) {
28136
28140
  const existing = state.seen.get(value);
28137
28141
  if (existing !== void 0) return existing;
28142
+ if (state.structuredClone) {
28143
+ try {
28144
+ typedArrayStorage(value, true);
28145
+ } catch (error) {
28146
+ if (!(error instanceof TypeError)) throw error;
28147
+ throw new DOMException("Cannot clone an out-of-bounds typed array.", "DataCloneError");
28148
+ }
28149
+ }
28138
28150
  const copy = copyTypedArrayStorage(value, state);
28139
28151
  state.seen.set(value, copy);
28140
28152
  if (state.structuredClone) return copy;
@@ -42816,4 +42828,4 @@ export {
42816
42828
  FileSnapshotBackend,
42817
42829
  run
42818
42830
  };
42819
- //# sourceMappingURL=chunk-RHEDM44A.js.map
42831
+ //# sourceMappingURL=chunk-UPTA6E3T.js.map