We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 117e942 commit 5394770Copy full SHA for 5394770
1 file changed
html/js/sandbox.js
@@ -371,8 +371,10 @@
371
catchPos = stat.end
372
}
373
if (stat.type == "VariableDeclaration" && stat.kind != "var") {
374
- let found = findAssignmentsTo(stat.declarations, ast)
375
- if (found) patches.push({from: 0, text: `throw new TypeError("invalid assignment to const '${found}'");`})
+ if (stat.kind == "const") {
+ let found = findAssignmentsTo(stat.declarations, ast)
376
+ if (found) patches.push({from: 0, text: `throw new TypeError("invalid assignment to const '${found}'");`})
377
+ }
378
patches.push({from: stat.start, to: stat.start + stat.kind.length, text: "var"})
379
380
if (stat.type == "ClassDeclaration")
0 commit comments