Skip to content

Commit 8072045

Browse files
committed
Revert "Merge pull request #250 from SarahIsWeird/main"
This reverts commit d4bf990, reversing changes made to 2ac9caf.
1 parent e3e8246 commit 8072045

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

src/processScript/transform.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -891,21 +891,8 @@ export function transform(
891891
parent.superClass = t.identifier(`Object`)
892892
},
893893
VariableDeclaration({ node: variableDeclaration }) {
894-
if (variableDeclaration.kind == `const`) {
894+
if (variableDeclaration.kind == `const`)
895895
variableDeclaration.kind = `let`
896-
variableDeclaration.extra = { ...variableDeclaration.extra, usedToBeConst: true }
897-
}
898-
},
899-
AssignmentExpression({ node: assignment, scope }) {
900-
const lhs = assignment.left
901-
902-
if (lhs.type != `Identifier`)
903-
return
904-
905-
const binding = scope.getBinding(lhs.name)
906-
907-
if (binding?.path?.parentPath?.node?.extra?.usedToBeConst)
908-
throw new Error(`Reassignment to const variable ${lhs.name} is not allowed!`)
909896
},
910897
ThisExpression: path => {
911898
path.replaceWith(t.identifier(`undefined`))

0 commit comments

Comments
 (0)