poe-code 14.0.73 → 14.0.75

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.
Files changed (47) hide show
  1. package/dist/index.js +2732 -1188
  2. package/dist/index.js.map +4 -4
  3. package/dist/metafile.json +1 -1
  4. package/package.json +1 -1
  5. package/packages/safe-js/dist/chunks/{chunk-I2Z37MKZ.js → chunk-BAJI3K4B.js} +2 -2
  6. package/packages/safe-js/dist/chunks/{chunk-XKCTB5FR.js → chunk-EOTY4PCT.js} +2902 -1425
  7. package/packages/safe-js/dist/chunks/chunk-EOTY4PCT.js.map +7 -0
  8. package/packages/safe-js/dist/cli.js +2 -2
  9. package/packages/safe-js/dist/core.js +1 -1
  10. package/packages/safe-js/dist/graph-depth.js +3 -0
  11. package/packages/safe-js/dist/index.js +2 -2
  12. package/packages/safe-js/dist/interp/cancel.js +3 -0
  13. package/packages/safe-js/dist/interp/globals/misc.js +2 -1
  14. package/packages/safe-js/dist/interp/globals/object.js +3 -0
  15. package/packages/safe-js/dist/interp/globals/regex.js +196 -9
  16. package/packages/safe-js/dist/interp/interpreter.js +14 -7
  17. package/packages/safe-js/dist/interp/iteration.js +9 -1
  18. package/packages/safe-js/dist/interp/methods/regex-split.d.ts +3 -0
  19. package/packages/safe-js/dist/interp/methods/regex-split.js +102 -0
  20. package/packages/safe-js/dist/interp/methods/regex.d.ts +8 -4
  21. package/packages/safe-js/dist/interp/methods/regex.js +141 -24
  22. package/packages/safe-js/dist/interp/methods/regexp-iterator.d.ts +12 -0
  23. package/packages/safe-js/dist/interp/methods/regexp-iterator.js +101 -0
  24. package/packages/safe-js/dist/interp/methods/string.d.ts +2 -0
  25. package/packages/safe-js/dist/interp/methods/string.js +415 -121
  26. package/packages/safe-js/dist/interp/object-model.d.ts +3 -0
  27. package/packages/safe-js/dist/interp/object-model.js +43 -10
  28. package/packages/safe-js/dist/interp/regex/compile-guard.js +26 -4
  29. package/packages/safe-js/dist/interp/regex/engine.d.ts +4 -0
  30. package/packages/safe-js/dist/interp/regex/engine.js +230 -30
  31. package/packages/safe-js/dist/interp/regex/parse.d.ts +42 -4
  32. package/packages/safe-js/dist/interp/regex/parse.js +429 -25
  33. package/packages/safe-js/dist/interp/regexp-iterator.d.ts +16 -0
  34. package/packages/safe-js/dist/interp/regexp-iterator.js +23 -0
  35. package/packages/safe-js/dist/interp/string-coercion.js +11 -7
  36. package/packages/safe-js/dist/interp/values.d.ts +2 -1
  37. package/packages/safe-js/dist/interp/values.js +39 -2
  38. package/packages/safe-js/dist/snapshot/dump-format.js +35 -3
  39. package/packages/safe-js/dist/snapshot/replay-data.d.ts +12 -1
  40. package/packages/safe-js/dist/snapshot/replay-data.js +42 -1
  41. package/packages/safe-js/dist/snapshot/replay-inputs.js +17 -0
  42. package/packages/safe-js/dist/snapshot/restore.js +23 -1
  43. package/packages/safe-js/dist/snapshot/serialize.d.ts +13 -2
  44. package/packages/safe-js/dist/snapshot/serialize.js +30 -11
  45. package/packages/safe-js/dist/snapshot/validation.js +22 -2
  46. package/packages/safe-js/dist/chunks/chunk-XKCTB5FR.js.map +0 -7
  47. /package/packages/safe-js/dist/chunks/{chunk-I2Z37MKZ.js.map → chunk-BAJI3K4B.js.map} +0 -0
@@ -85,6 +85,10 @@ function validateDumpHeap(root, state) {
85
85
  const entry = requireRecord(value, path);
86
86
  validateErrorType(entry, path);
87
87
  validateSymbolEntries(entry, path, state, heap);
88
+ if (entry.kind === "regexp-iterator") {
89
+ validateHeapValue(entry, path, state, heap);
90
+ continue;
91
+ }
88
92
  if (entry.kind === "regex-object") {
89
93
  validateTaggedValue(entry, path, state);
90
94
  continue;
@@ -111,6 +115,8 @@ function validateDumpHeap(root, state) {
111
115
  continue;
112
116
  }
113
117
  if (entry.kind === "object") {
118
+ if (Object.hasOwn(entry, "sandboxNullPrototype") && entry.sandboxNullPrototype !== true)
119
+ fail("invalidValue", `${path}.sandboxNullPrototype`, "invalid object prototype");
114
120
  requireRecord(entry.entries, `${path}.entries`);
115
121
  continue;
116
122
  }
@@ -390,10 +396,15 @@ function validateTaggedValue(record, path, state) {
390
396
  return;
391
397
  case "array":
392
398
  case "arguments":
399
+ return;
393
400
  case "object":
401
+ if (Object.hasOwn(record, "sandboxNullPrototype") && record.sandboxNullPrototype !== true)
402
+ fail("invalidValue", `${path}.sandboxNullPrototype`, "invalid object prototype");
403
+ return;
394
404
  case "map":
395
405
  case "set":
396
406
  case "collection-iterator":
407
+ case "regexp-iterator":
397
408
  return;
398
409
  }
399
410
  }
@@ -440,7 +451,7 @@ function validateGeneratorShape(record, path, state) {
440
451
  function validateHeapValue(value, path, state, heap) {
441
452
  const record = requireRecord(value, path);
442
453
  validateErrorType(record, path);
443
- if (!["symbol", "arguments", "array", "object", "map", "set", "float32array", "date", "boxed", "collection-iterator", "regex-object"].includes(String(record.kind)))
454
+ if (!["symbol", "arguments", "array", "object", "map", "set", "float32array", "date", "boxed", "collection-iterator", "regexp-iterator", "regex-object"].includes(String(record.kind)))
444
455
  fail("unknownTag", `${path}.kind`, "unknown heap tag");
445
456
  validateValue(record, path, 1, state);
446
457
  if (record.kind === "symbol")
@@ -468,6 +479,15 @@ function validateHeapValue(value, path, state, heap) {
468
479
  }
469
480
  if (record.kind === "set")
470
481
  requireArray(record.values, `${path}.values`, state);
482
+ if (record.kind === "regexp-iterator") {
483
+ if ((record.global !== undefined || record.unicode !== undefined) && (typeof record.global !== "boolean" || typeof record.unicode !== "boolean"))
484
+ fail("invalidValue", path, "invalid RegExp iterator modes");
485
+ if (typeof record.exhausted !== "boolean")
486
+ fail("invalidValue", `${path}.exhausted`, "invalid iterator exhaustion");
487
+ if (!Object.hasOwn(record, "matcher") || !Object.hasOwn(record, "input"))
488
+ fail("invalidValue", path, "missing RegExp iterator state");
489
+ requireRecord(record.entries, `${path}.entries`);
490
+ }
471
491
  if (record.kind === "collection-iterator") {
472
492
  if (record.collectionKind !== "map" && record.collectionKind !== "set")
473
493
  fail("invalidValue", `${path}.collectionKind`, "invalid iterator brand");
@@ -484,7 +504,7 @@ function validateHeapValue(value, path, state, heap) {
484
504
  function validateSymbolEntries(record, path, state, heap) {
485
505
  if (record.symbolEntries === undefined)
486
506
  return;
487
- if (record.kind !== "object" && record.kind !== "array" && record.kind !== "date" && record.kind !== "boxed" && record.kind !== "regex-object")
507
+ if (record.kind !== "object" && record.kind !== "array" && record.kind !== "date" && record.kind !== "boxed" && record.kind !== "regex-object" && record.kind !== "regexp-iterator")
488
508
  fail("invalidValue", `${path}.symbolEntries`, "symbol properties are unsupported for this heap kind");
489
509
  const entries = requireArray(record.symbolEntries, `${path}.symbolEntries`, state);
490
510
  const keys = new Set();