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.
@@ -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 {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "marko",
3
- "version": "6.0.166",
3
+ "version": "6.0.168",
4
4
  "description": "Optimized runtime for Marko templates.",
5
5
  "keywords": [
6
6
  "api",