marko 6.0.0-next.3.31 → 6.0.0-next.3.32
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/translator/index.js
CHANGED
@@ -1102,6 +1102,7 @@ function startSection(path5) {
|
|
1102
1102
|
params: void 0,
|
1103
1103
|
closures: void 0,
|
1104
1104
|
bindings: void 0,
|
1105
|
+
assignments: void 0,
|
1105
1106
|
content: getContentInfo(path5),
|
1106
1107
|
upstreamExpression: void 0,
|
1107
1108
|
hasAbortSignal: false,
|
@@ -2512,6 +2513,18 @@ function writeHTMLResumeStatements(path5, tagVarIdentifier) {
|
|
2512
2513
|
if (!section) return;
|
2513
2514
|
const allSignals = Array.from(getSignals(section).values());
|
2514
2515
|
const scopeIdIdentifier = getScopeIdIdentifier(section);
|
2516
|
+
forEach(section.assignments, (assignment) => {
|
2517
|
+
let currentSection = section;
|
2518
|
+
while (currentSection !== assignment.section) {
|
2519
|
+
getSerializedScopeProperties(currentSection).set(
|
2520
|
+
import_compiler17.types.stringLiteral("_"),
|
2521
|
+
callRuntime(
|
2522
|
+
"ensureScopeWithId",
|
2523
|
+
getScopeIdIdentifier(currentSection = currentSection.parent)
|
2524
|
+
)
|
2525
|
+
);
|
2526
|
+
}
|
2527
|
+
});
|
2515
2528
|
forEach(section.closures, (closure) => {
|
2516
2529
|
if (isStatefulReferences(closure)) {
|
2517
2530
|
let currentSection = section;
|
@@ -3350,6 +3363,7 @@ function trackAssignment(assignment, binding) {
|
|
3350
3363
|
forEachIdentifier(assignment.node, (id) => {
|
3351
3364
|
if (id.name === binding.name) {
|
3352
3365
|
const extra = id.extra ??= {};
|
3366
|
+
section.assignments = bindingUtil.add(section.assignments, binding);
|
3353
3367
|
extra.assignment = binding;
|
3354
3368
|
extra.section = section;
|
3355
3369
|
}
|
@@ -16,6 +16,7 @@ export interface Section {
|
|
16
16
|
params: undefined | Binding;
|
17
17
|
closures: ReferencedBindings;
|
18
18
|
bindings: ReferencedBindings;
|
19
|
+
assignments: ReferencedBindings;
|
19
20
|
upstreamExpression: t.NodeExtra | undefined;
|
20
21
|
hasAbortSignal: boolean;
|
21
22
|
isBranch: boolean;
|
@@ -29,10 +30,6 @@ declare module "@marko/compiler/dist/types" {
|
|
29
30
|
interface ProgramExtra {
|
30
31
|
section?: Section;
|
31
32
|
sections?: Section[];
|
32
|
-
assignments?: [
|
33
|
-
valueSection: Section,
|
34
|
-
assignment: t.NodePath<t.UpdateExpression> | t.NodePath<t.AssignmentExpression>
|
35
|
-
][];
|
36
33
|
}
|
37
34
|
interface MarkoTagBodyExtra {
|
38
35
|
section?: Section;
|