@poe-platform/safe-js 0.1.359 → 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-Q4GWH6GV.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-HPP5CU3X.js.map
8252
+ //# sourceMappingURL=chunk-MGIF45X7.js.map
@@ -6888,7 +6888,17 @@ function arrayBufferDataProperties(value) {
6888
6888
  }
6889
6889
 
6890
6890
  // packages/safe-js/src/interp/typed-array.ts
6891
- var numericTypedArrayConstructors = { Float32Array, Uint8Array };
6891
+ var numericTypedArrayConstructors = {
6892
+ Float32Array,
6893
+ Uint8Array,
6894
+ Int8Array,
6895
+ Uint8ClampedArray,
6896
+ Int16Array,
6897
+ Uint16Array,
6898
+ Int32Array,
6899
+ Uint32Array,
6900
+ Float64Array
6901
+ };
6892
6902
  var typedArrayPrototype = Object.getPrototypeOf(Float32Array.prototype);
6893
6903
  var readLength2 = Object.getOwnPropertyDescriptor(typedArrayPrototype, "length").get;
6894
6904
  var readOffset = Object.getOwnPropertyDescriptor(typedArrayPrototype, "byteOffset").get;
@@ -19693,6 +19703,7 @@ function typeTag(value, builtinOnly = false) {
19693
19703
 
19694
19704
  // packages/safe-js/src/interp/exceptions.ts
19695
19705
  var capturedExceptionBrand = /* @__PURE__ */ Symbol("CapturedException");
19706
+ var readDOMExceptionCode = Object.getOwnPropertyDescriptor(DOMException.prototype, "code").get;
19696
19707
  internalSymbols.add(capturedExceptionBrand);
19697
19708
  async function evaluateThrowStatement(node, context, evaluateNode2) {
19698
19709
  const argument = await evaluateNode2(node.argument, context);
@@ -19805,11 +19816,14 @@ function coerceThrownValue(reason, budget, stackFrames, span, sandbox = false) {
19805
19816
  return reason;
19806
19817
  }
19807
19818
  if (reason instanceof Error) {
19808
- return createSubsetErrorValue(reason.name || "Error", reason.message, stackFrames, budget, {
19819
+ const error = createSubsetErrorValue(reason.name || "Error", reason.message, stackFrames, budget, {
19809
19820
  chargeBudget: false,
19810
19821
  cause: readErrorCause(reason),
19811
19822
  span
19812
19823
  });
19824
+ if (reason instanceof DOMException)
19825
+ Object.defineProperty(error, "code", { value: Reflect.apply(readDOMExceptionCode, reason, []), enumerable: true });
19826
+ return error;
19813
19827
  }
19814
19828
  if (sandbox) {
19815
19829
  return reason;
@@ -28125,6 +28139,14 @@ function copyToSandbox(value, state, path = "<root>", cloneSandboxCollections =
28125
28139
  if (isNumericTypedArray(value)) {
28126
28140
  const existing = state.seen.get(value);
28127
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
+ }
28128
28150
  const copy = copyTypedArrayStorage(value, state);
28129
28151
  state.seen.set(value, copy);
28130
28152
  if (state.structuredClone) return copy;
@@ -30301,6 +30323,13 @@ var KNOWN_RUNTIME_GLOBALS = [
30301
30323
  "Map",
30302
30324
  "Float32Array",
30303
30325
  "Uint8Array",
30326
+ "Int8Array",
30327
+ "Uint8ClampedArray",
30328
+ "Int16Array",
30329
+ "Uint16Array",
30330
+ "Int32Array",
30331
+ "Uint32Array",
30332
+ "Float64Array",
30304
30333
  "Math",
30305
30334
  "NaN",
30306
30335
  "Number",
@@ -42799,4 +42828,4 @@ export {
42799
42828
  FileSnapshotBackend,
42800
42829
  run
42801
42830
  };
42802
- //# sourceMappingURL=chunk-Q4GWH6GV.js.map
42831
+ //# sourceMappingURL=chunk-UPTA6E3T.js.map