marko 6.0.166 → 6.0.168
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/debug/dom.js +1 -1
- package/dist/debug/dom.mjs +1 -1
- package/dist/debug/html.js +4 -2
- package/dist/debug/html.mjs +4 -2
- package/dist/html/writer.d.ts +1 -1
- package/dist/html.js +396 -390
- package/dist/html.mjs +395 -389
- package/dist/translator/index.js +2 -1
- package/package.json +1 -1
package/dist/translator/index.js
CHANGED
|
@@ -8265,8 +8265,9 @@ var dynamic_tag_default = {
|
|
|
8265
8265
|
const dynamicTagExpr = hasTagArgs ? callRuntime("_dynamic_tag", getScopeIdIdentifier(tagSection), getScopeAccessorLiteral(nodeBinding), tagExpression, _marko_compiler.types.arrayExpression(args), _marko_compiler.types.numericLiteral(0), _marko_compiler.types.numericLiteral(1), serializeArg) : callRuntime("_dynamic_tag", getScopeIdIdentifier(tagSection), getScopeAccessorLiteral(nodeBinding), tagExpression, args[0], args[1] || (serializeArg ? _marko_compiler.types.numericLiteral(0) : void 0), serializeArg ? _marko_compiler.types.numericLiteral(0) : void 0, serializeArg);
|
|
8266
8266
|
if (node.var) {
|
|
8267
8267
|
const dynamicScopeIdentifier = generateUidIdentifier(tag.get("name").toString() + "_scope");
|
|
8268
|
+
const mutatesTagVar = !!(tag.node.var.type === "Identifier" && tag.scope.getBinding(tag.node.var.name)?.constantViolations.length);
|
|
8268
8269
|
statements.push(_marko_compiler.types.variableDeclaration("const", [_marko_compiler.types.variableDeclarator(dynamicScopeIdentifier, callRuntime("_peek_scope_id"))]));
|
|
8269
|
-
statements.push(_marko_compiler.types.variableDeclaration("let", [_marko_compiler.types.variableDeclarator(node.var, dynamicTagExpr)]), _marko_compiler.types.expressionStatement(callRuntime("_var", getScopeIdIdentifier(tagSection), getScopeAccessorLiteral(tag.node.extra[kChildOffsetScopeBinding]), dynamicScopeIdentifier, _marko_compiler.types.stringLiteral(getResumeRegisterId(tagSection, node.var.extra?.binding, "var")))));
|
|
8270
|
+
statements.push(_marko_compiler.types.variableDeclaration("let", [_marko_compiler.types.variableDeclarator(node.var, dynamicTagExpr)]), _marko_compiler.types.expressionStatement(callRuntime("_var", getScopeIdIdentifier(tagSection), getScopeAccessorLiteral(tag.node.extra[kChildOffsetScopeBinding]), dynamicScopeIdentifier, _marko_compiler.types.stringLiteral(getResumeRegisterId(tagSection, node.var.extra?.binding, "var")), mutatesTagVar ? getScopeAccessorLiteral(nodeBinding) : void 0)));
|
|
8270
8271
|
} else statements.push(_marko_compiler.types.expressionStatement(dynamicTagExpr));
|
|
8271
8272
|
for (const replacement of tag.replaceWithMultiple(statements)) replacement.skip();
|
|
8272
8273
|
} else {
|