Skip to content

Commit

Permalink
use find_owner instead
Browse files Browse the repository at this point in the history
  • Loading branch information
tanhauhau committed Oct 13, 2022
1 parent 1cdf3e0 commit 191ab85
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/compiler/compile/nodes/shared/Expression.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,16 +153,7 @@ export default class Expression {
variable[deep ? 'mutated' : 'reassigned'] = true;
}

let current_scope = scope;
let declaration;

while (current_scope) {
if (current_scope.declarations.has(name)) {
declaration = current_scope.declarations.get(name);
break;
}
current_scope = current_scope.parent;
}
const declaration: any = scope.find_owner(name)?.declarations.get(name);

if (declaration) {
if (declaration.kind === 'const' && !deep) {
Expand Down

0 comments on commit 191ab85

Please sign in to comment.