@poe-platform/safe-js 0.1.235 → 0.1.236
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.
- package/dist/safe-js/chunks/{chunk-YWUDIBFW.js → chunk-IMG6SFST.js} +2 -2
- package/dist/safe-js/chunks/{chunk-63CXQYH2.js → chunk-YXXCUBTE.js} +30 -3
- package/dist/safe-js/chunks/{chunk-63CXQYH2.js.map → chunk-YXXCUBTE.js.map} +2 -2
- package/dist/safe-js/cli.js +2 -2
- package/dist/safe-js/core.js +1 -1
- package/dist/safe-js/index.js +2 -2
- package/dist/safe-js/interp/generator-expression-state.d.ts +3 -0
- package/package.json +2 -2
- /package/dist/safe-js/chunks/{chunk-YWUDIBFW.js.map → chunk-IMG6SFST.js.map} +0 -0
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
validateMigrationSemantics,
|
|
28
28
|
validateSnapshotData,
|
|
29
29
|
validateSnapshotMigration
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-YXXCUBTE.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-
|
|
8252
|
+
//# sourceMappingURL=chunk-IMG6SFST.js.map
|
|
@@ -15859,10 +15859,19 @@ async function evaluateExportNamedDeclaration(node, context) {
|
|
|
15859
15859
|
return evaluateVariableDeclaration(node.declaration, context);
|
|
15860
15860
|
}
|
|
15861
15861
|
async function evaluateVariableDeclaration(node, context) {
|
|
15862
|
+
const saved = context.generatorResume === void 0 || node.nodeId === void 0 ? void 0 : context.restoredGeneratorExpressionStates?.get(node.nodeId);
|
|
15863
|
+
if (saved !== void 0 && saved.kind !== "declaration") throw new TypeError("Invalid declaration continuation.");
|
|
15862
15864
|
if (node.kind !== "var") {
|
|
15863
15865
|
predeclareDeclarationBindings(node, context.scope);
|
|
15864
15866
|
}
|
|
15865
|
-
for (
|
|
15867
|
+
for (let index = saved?.index ?? 0; index < node.declarations.length; index++) {
|
|
15868
|
+
const declarator = node.declarations[index];
|
|
15869
|
+
if (context.generatorYield !== void 0 && node.nodeId !== void 0) {
|
|
15870
|
+
context = { ...context, generatorExpressionStates: new Map([
|
|
15871
|
+
...context.generatorExpressionStates ?? [],
|
|
15872
|
+
[node.nodeId, { kind: "declaration", index }]
|
|
15873
|
+
]) };
|
|
15874
|
+
}
|
|
15866
15875
|
if (node.kind === "var" && declarator.init === void 0 && declarator.id.type === "Identifier" && context.scope.lookup(declarator.id.name).found) {
|
|
15867
15876
|
continue;
|
|
15868
15877
|
}
|
|
@@ -16621,6 +16630,12 @@ async function bindIterationVariable(left, value, scope, context) {
|
|
|
16621
16630
|
if (left.declarations.length !== 1 || declarator === void 0) {
|
|
16622
16631
|
throw new TypeError("for...of declarations must include exactly one declarator.");
|
|
16623
16632
|
}
|
|
16633
|
+
if (context.generatorYield !== void 0 && left.nodeId !== void 0) {
|
|
16634
|
+
context = { ...context, generatorExpressionStates: new Map([
|
|
16635
|
+
...context.generatorExpressionStates ?? [],
|
|
16636
|
+
[left.nodeId, { kind: "declaration", index: 0 }]
|
|
16637
|
+
]) };
|
|
16638
|
+
}
|
|
16624
16639
|
return bindPattern2(declarator.id, value, { kind: left.kind }, scope, createPatternContext(context, scope));
|
|
16625
16640
|
}
|
|
16626
16641
|
async function evaluateExpressionStatement(node, context) {
|
|
@@ -21018,7 +21033,7 @@ function captureGuestHeapNode(value, encode) {
|
|
|
21018
21033
|
...value.state !== "suspended" || origin2.expressionStates === void 0 ? {} : {
|
|
21019
21034
|
expressionStates: Object.fromEntries([...origin2.expressionStates].map(([id, expression]) => [
|
|
21020
21035
|
String(id),
|
|
21021
|
-
expression.kind === "binary" ? { kind: "binary", left: encode(expression.left) } : expression.kind === "pattern-source" ? { kind: "pattern-source", value: encode(expression.value) } : expression.kind === "object-pattern" ? {
|
|
21036
|
+
expression.kind === "binary" ? { kind: "binary", left: encode(expression.left) } : expression.kind === "declaration" ? { ...expression } : expression.kind === "pattern-source" ? { kind: "pattern-source", value: encode(expression.value) } : expression.kind === "object-pattern" ? {
|
|
21022
21037
|
kind: "object-pattern",
|
|
21023
21038
|
phase: expression.phase,
|
|
21024
21039
|
index: expression.index,
|
|
@@ -22684,6 +22699,9 @@ function validateGuestHeapNode(raw, heap, maxArrayLength = 4294967295) {
|
|
|
22684
22699
|
const expression = record2(raw2);
|
|
22685
22700
|
if (expression.kind === "binary") {
|
|
22686
22701
|
fields(expression, ["kind", "left"]);
|
|
22702
|
+
} else if (expression.kind === "declaration") {
|
|
22703
|
+
fields(expression, ["kind", "index"]);
|
|
22704
|
+
integer(expression.index);
|
|
22687
22705
|
} else if (expression.kind === "pattern-source") {
|
|
22688
22706
|
fields(expression, ["kind", "value"]);
|
|
22689
22707
|
} else if (expression.kind === "object-pattern") {
|
|
@@ -22892,6 +22910,15 @@ function validateGuestFunctionAst(record3, origin) {
|
|
|
22892
22910
|
yieldExpressions = frame.expressions;
|
|
22893
22911
|
}
|
|
22894
22912
|
for (const [key, value] of Object.entries(node)) {
|
|
22913
|
+
if (node.type === "VariableDeclaration" && key === "declarations" && typeof node.nodeId === "number" && Array.isArray(value)) {
|
|
22914
|
+
value.forEach((declarator, index) => pending.push({
|
|
22915
|
+
value: declarator,
|
|
22916
|
+
blocks,
|
|
22917
|
+
finalizers: frame.finalizers,
|
|
22918
|
+
expressions: new Map([...frame.expressions, [node.nodeId, { kind: "declaration", index }]])
|
|
22919
|
+
}));
|
|
22920
|
+
continue;
|
|
22921
|
+
}
|
|
22895
22922
|
if (node.type === "TaggedTemplateExpression" && key === "quasi") {
|
|
22896
22923
|
value.expressions.forEach((expression, index) => {
|
|
22897
22924
|
pending.push({
|
|
@@ -39231,4 +39258,4 @@ export {
|
|
|
39231
39258
|
FileSnapshotBackend,
|
|
39232
39259
|
run
|
|
39233
39260
|
};
|
|
39234
|
-
//# sourceMappingURL=chunk-
|
|
39261
|
+
//# sourceMappingURL=chunk-YXXCUBTE.js.map
|