11
lib/scope.js
11
lib/scope.js
@@ -100,6 +100,8 @@ SymbolDef.prototype = {
|
||||
},
|
||||
};
|
||||
|
||||
var unary_side_effects = makePredicate("delete ++ --");
|
||||
|
||||
AST_Toplevel.DEFMETHOD("figure_out_scope", function(options) {
|
||||
options = defaults(options, {
|
||||
cache: null,
|
||||
@@ -256,8 +258,13 @@ AST_Toplevel.DEFMETHOD("figure_out_scope", function(options) {
|
||||
} else if (name == "arguments"
|
||||
&& sym.orig[0] instanceof AST_SymbolFunarg
|
||||
&& !(sym.scope instanceof AST_Arrow)) {
|
||||
if (!(tw.parent() instanceof AST_PropAccess)) {
|
||||
sym.scope.uses_arguments = "d";
|
||||
var parent = tw.parent();
|
||||
if (parent instanceof AST_Assign && parent.left === node
|
||||
|| parent instanceof AST_Unary && unary_side_effects[parent.operator]) {
|
||||
sym.scope.uses_arguments = 3;
|
||||
} else if (sym.scope.uses_arguments < 2
|
||||
&& !(parent instanceof AST_PropAccess && parent.expression === node)) {
|
||||
sym.scope.uses_arguments = 2;
|
||||
} else if (!sym.scope.uses_arguments) {
|
||||
sym.scope.uses_arguments = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user