consolidate evaluate & reduce_vars (#1505)

- improve marking efficiency
- apply smarter `const` replacement to `var`

fixes #1501
This commit is contained in:
Alex Lam S.L
2017-02-26 00:40:33 +08:00
committed by GitHub
parent 834f9f3924
commit 16cd5d57a5
5 changed files with 57 additions and 50 deletions

View File

@@ -51,7 +51,6 @@ function SymbolDef(scope, index, orig) {
this.global = false;
this.mangled_name = null;
this.undeclared = false;
this.constant = false;
this.index = index;
this.id = SymbolDef.next_id++;
};
@@ -156,7 +155,6 @@ AST_Toplevel.DEFMETHOD("figure_out_scope", function(options){
else if (node instanceof AST_SymbolVar
|| node instanceof AST_SymbolConst) {
var def = defun.def_variable(node);
def.constant = node instanceof AST_SymbolConst;
def.init = tw.parent().value;
}
else if (node instanceof AST_SymbolCatch) {