reduce this in block scopes (#2526)

fixes #2455
This commit is contained in:
Alex Lam S.L
2017-11-28 22:54:21 +08:00
committed by GitHub
parent 37cbd7080c
commit 62d2817d6c
4 changed files with 24 additions and 8 deletions

View File

@@ -313,9 +313,9 @@ var AST_Scope = DEFNODE("Scope", "variables functions uses_with uses_eval parent
enclosed: "[SymbolDef*/S] a list of all symbol definitions that are accessed from this scope or any subscopes",
cname: "[integer/S] current index for mangling variables (used internally by the mangler)",
},
get_defun_scope: function () {
get_defun_scope: function() {
var self = this;
while (self.is_block_scope() && self.parent_scope) {
while (self.is_block_scope()) {
self = self.parent_scope;
}
return self;