@poe-platform/safe-js 0.1.218 → 0.1.219

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-7FIJ3D55.js";
30
+ } from "./chunk-UIOUG27J.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-Z3GR3FJR.js.map
8252
+ //# sourceMappingURL=chunk-T6BZBXWY.js.map
@@ -8538,7 +8538,7 @@ function captureGuestHeapNode(value, encode) {
8538
8538
  ...value.state !== "suspended" || origin2.expressionStates === void 0 ? {} : {
8539
8539
  expressionStates: Object.fromEntries([...origin2.expressionStates].map(([id, expression]) => [
8540
8540
  String(id),
8541
- expression.kind === "binary" ? { kind: "binary", left: encode(expression.left) } : expression.kind === "object" ? {
8541
+ expression.kind === "binary" ? { kind: "binary", left: encode(expression.left) } : expression.kind === "template" ? { ...expression } : expression.kind === "object" ? {
8542
8542
  kind: "object",
8543
8543
  value: encode(expression.value),
8544
8544
  index: expression.index,
@@ -16600,11 +16600,20 @@ function isObjectPrototypeSetterProperty(property, key) {
16600
16600
  return !property.computed && !property.shorthand && key === "__proto__" && !(property.value.type === "FunctionExpression" && property.value.method === true);
16601
16601
  }
16602
16602
  async function evaluateTemplateLiteral(node, context) {
16603
- let value = context.budget.allocateString(node.quasis[0]?.value.cooked ?? "");
16603
+ const restored = context.generatorResume === void 0 || node.nodeId === void 0 ? void 0 : context.restoredGeneratorExpressionStates?.get(node.nodeId);
16604
+ if (restored !== void 0 && restored.kind !== "template") throw new TypeError("Invalid template continuation.");
16605
+ const state = { kind: "template", prefix: restored?.prefix ?? "", index: restored?.index ?? 0 };
16606
+ let value = context.budget.allocateString(restored?.prefix ?? node.quasis[0]?.value.cooked ?? "");
16607
+ if (context.generatorYield !== void 0 && node.nodeId !== void 0) context = {
16608
+ ...context,
16609
+ generatorExpressionStates: new Map([...context.generatorExpressionStates ?? [], [node.nodeId, state]])
16610
+ };
16604
16611
  let input = void 0;
16605
16612
  const release = retainValues(context.budget, () => [value, input]);
16606
16613
  try {
16607
- for (let index = 0; index < node.expressions.length; index += 1) {
16614
+ for (let index = state.index; index < node.expressions.length; index += 1) {
16615
+ state.index = index;
16616
+ state.prefix = value;
16608
16617
  const expression = await evaluateNode(node.expressions[index], context);
16609
16618
  if (expression.kind !== "normal") {
16610
16619
  return expression;
@@ -22382,6 +22391,10 @@ function validateGuestHeapNode(raw, heap) {
22382
22391
  const expression = record2(raw2);
22383
22392
  if (expression.kind === "binary") {
22384
22393
  fields(expression, ["kind", "left"]);
22394
+ } else if (expression.kind === "template") {
22395
+ fields(expression, ["kind", "prefix", "index"]);
22396
+ integer(expression.index);
22397
+ if (typeof expression.prefix !== "string") throw new TypeError("Invalid template prefix.");
22385
22398
  } else if (expression.kind === "object") {
22386
22399
  fields(expression, ["kind", "value", "index"], ["key"]);
22387
22400
  integer(expression.index);
@@ -22504,6 +22517,15 @@ function validateGuestFunctionAst(record3, origin) {
22504
22517
  yieldExpressions = frame.expressions;
22505
22518
  }
22506
22519
  for (const [key, value] of Object.entries(node)) {
22520
+ if (node.type === "TaggedTemplateExpression" && key === "quasi") {
22521
+ pending.push({
22522
+ value: value.expressions,
22523
+ blocks,
22524
+ finalizers: frame.finalizers,
22525
+ expressions: frame.expressions
22526
+ });
22527
+ continue;
22528
+ }
22507
22529
  if (node.type === "ObjectExpression" && key === "properties" && typeof node.nodeId === "number" && Array.isArray(value)) {
22508
22530
  const id = node.nodeId;
22509
22531
  value.forEach((property, index) => {
@@ -22525,8 +22547,8 @@ function validateGuestFunctionAst(record3, origin) {
22525
22547
  });
22526
22548
  continue;
22527
22549
  }
22528
- if ((node.type === "ArrayExpression" && key === "elements" || (node.type === "CallExpression" || node.type === "NewExpression") && key === "arguments") && typeof node.nodeId === "number" && Array.isArray(value)) {
22529
- const kind = node.type === "ArrayExpression" ? "array" : node.type === "CallExpression" ? "call" : "new";
22550
+ if ((node.type === "ArrayExpression" && key === "elements" || node.type === "TemplateLiteral" && key === "expressions" || (node.type === "CallExpression" || node.type === "NewExpression") && key === "arguments") && typeof node.nodeId === "number" && Array.isArray(value)) {
22551
+ const kind = node.type === "ArrayExpression" ? "array" : node.type === "TemplateLiteral" ? "template" : node.type === "CallExpression" ? "call" : "new";
22530
22552
  value.forEach((element, index) => pending.push({
22531
22553
  value: element,
22532
22554
  blocks,
@@ -38753,4 +38775,4 @@ export {
38753
38775
  FileSnapshotBackend,
38754
38776
  run
38755
38777
  };
38756
- //# sourceMappingURL=chunk-7FIJ3D55.js.map
38778
+ //# sourceMappingURL=chunk-UIOUG27J.js.map