use find_owner instead

pull/4960/head
tanhauhau 4 years ago
parent 1cdf3e01ce
commit 191ab853d4

@ -153,16 +153,7 @@ export default class Expression {
variable[deep ? 'mutated' : 'reassigned'] = true; variable[deep ? 'mutated' : 'reassigned'] = true;
} }
let current_scope = scope; const declaration: any = scope.find_owner(name)?.declarations.get(name);
let declaration;
while (current_scope) {
if (current_scope.declarations.has(name)) {
declaration = current_scope.declarations.get(name);
break;
}
current_scope = current_scope.parent;
}
if (declaration) { if (declaration) {
if (declaration.kind === 'const' && !deep) { if (declaration.kind === 'const' && !deep) {

Loading…
Cancel
Save