Skip to content

Commit

Permalink
fix: Use let instead of const for let tags on the server
Browse files Browse the repository at this point in the history
This resolves the issue where we could reassign const variables if the let variable was modified in callback functions.
  • Loading branch information
AngusMorton authored and DylanPiercey committed Mar 25, 2024
1 parent 07c6d7f commit e3de800
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/let/translate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default function translate(tag: t.NodePath<t.MarkoTag>) {
if (server) {
file.path.scope.crawl();
tag.replaceWith(
t.variableDeclaration("const", [
t.variableDeclaration("let", [
t.variableDeclarator(tagVar, deepFreeze(file, value)),
]),
);
Expand Down

0 comments on commit e3de800

Please sign in to comment.