add AST_SymbolConst for names defined with const
This commit is contained in:
@@ -49,6 +49,7 @@ function SymbolDef(scope, orig) {
|
||||
this.global = false;
|
||||
this.mangled_name = null;
|
||||
this.undeclared = false;
|
||||
this.constant = false;
|
||||
};
|
||||
|
||||
SymbolDef.prototype = {
|
||||
@@ -144,9 +145,11 @@ AST_Toplevel.DEFMETHOD("figure_out_scope", function(){
|
||||
(node.scope = scope.parent_scope).def_function(node);
|
||||
node.init.push(tw.parent());
|
||||
}
|
||||
else if (node instanceof AST_SymbolVar) {
|
||||
scope.def_variable(node);
|
||||
var def = tw.parent();
|
||||
else if (node instanceof AST_SymbolVar
|
||||
|| node instanceof AST_SymbolConst) {
|
||||
var def = scope.def_variable(node);
|
||||
def.constant = node instanceof AST_SymbolConst;
|
||||
def = tw.parent();
|
||||
if (def.value) node.init.push(def);
|
||||
}
|
||||
else if (node instanceof AST_SymbolCatch) {
|
||||
|
||||
Reference in New Issue
Block a user