Skip to content

Commit

Permalink
fix safari syntax error - decalring twice
Browse files Browse the repository at this point in the history
fix mishoo#1753.
to mangle names properly - to avoid safari error -, scope of for loop should enclose parent scope variables

Signed-off-by: Gyusun Yeom <omniavinco@gmail.com>
  • Loading branch information
Perlmint committed Apr 28, 2017
1 parent 278577f commit 983f3df
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/scope.js
Expand Up @@ -122,6 +122,12 @@ AST_Toplevel.DEFMETHOD("figure_out_scope", function(options){
scope.uses_eval = save_scope.uses_eval;
scope.directives = save_scope.directives;
}
// issue 1753 - name mangling in for loop scope should consider parent scope
if (node instanceof AST_For) {
save_scope.variables.each(function(def) {
push_uniq(scope.enclosed, def);
});
}
descend();
scope = save_scope;
return true;
Expand Down

0 comments on commit 983f3df

Please sign in to comment.