minor
This commit is contained in:
@@ -698,9 +698,9 @@ function TreeWalker(callback) {
|
||||
TreeWalker.prototype = {
|
||||
_visit: function(node, descend) {
|
||||
this.stack.push(node);
|
||||
var ret = this.visit(node, function(){
|
||||
var ret = this.visit(node, descend ? function(){
|
||||
descend.call(node);
|
||||
});
|
||||
} : noop);
|
||||
if (!ret && descend) {
|
||||
descend.call(node);
|
||||
}
|
||||
|
||||
10
lib/scope.js
10
lib/scope.js
@@ -209,6 +209,7 @@ AST_Toplevel.DEFMETHOD("figure_out_scope", function(){
|
||||
node.thedef = sym;
|
||||
}
|
||||
node.reference();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
self.walk(tw);
|
||||
@@ -225,6 +226,10 @@ AST_Scope.DEFMETHOD("init_scope_vars", function(){
|
||||
this.cname = -1; // the current index for mangling functions/variables
|
||||
});
|
||||
|
||||
AST_Scope.DEFMETHOD("strict", function(){
|
||||
return this.has_directive("use strict");
|
||||
});
|
||||
|
||||
AST_Lambda.DEFMETHOD("init_scope_vars", function(){
|
||||
AST_Scope.prototype.init_scope_vars.call(this);
|
||||
this.uses_arguments = false;
|
||||
@@ -298,6 +303,11 @@ AST_Scope.DEFMETHOD("next_mangled", function(){
|
||||
}
|
||||
});
|
||||
|
||||
AST_Scope.DEFMETHOD("references", function(sym){
|
||||
if (sym instanceof AST_Symbol) sym = sym.definition();
|
||||
return this.enclosed.indexOf(sym) < 0 ? null : sym;
|
||||
});
|
||||
|
||||
AST_Symbol.DEFMETHOD("unmangleable", function(){
|
||||
return this.definition().unmangleable();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user