fixed some mess with symbols/scope
- all symbols now have a `thedef` property which is a SymbolDef object, instead of the `uniq` that we had before (pointing to the first occurrence of the name as declaration). - for undeclared symbols we still create a SymbolDef object in the toplevel scope but mark it "undeclared" - we can now call figure_out_scope after squeezing, which is useful in order not to mangle names that were dropped by the squeezer
This commit is contained in:
@@ -549,11 +549,11 @@ var AST_ObjectGetter = DEFNODE("ObjectGetter", null, {
|
||||
$documentation: "An object getter property",
|
||||
}, AST_ObjectProperty);
|
||||
|
||||
var AST_Symbol = DEFNODE("Symbol", "scope name global undeclared", {
|
||||
var AST_Symbol = DEFNODE("Symbol", "scope name thedef", {
|
||||
$documentation: "Base class for all symbols",
|
||||
});
|
||||
|
||||
var AST_SymbolDeclaration = DEFNODE("SymbolDeclaration", "references", {
|
||||
var AST_SymbolDeclaration = DEFNODE("SymbolDeclaration", null, {
|
||||
$documentation: "A declaration symbol (symbol in var/const, function name or argument, symbol in catch)",
|
||||
}, AST_Symbol);
|
||||
|
||||
@@ -581,7 +581,7 @@ var AST_Label = DEFNODE("Label", null, {
|
||||
$documentation: "Symbol naming a label (declaration)",
|
||||
}, AST_SymbolDeclaration);
|
||||
|
||||
var AST_SymbolRef = DEFNODE("SymbolRef", "symbol", {
|
||||
var AST_SymbolRef = DEFNODE("SymbolRef", null, {
|
||||
$documentation: "Reference to some symbol (not definition/declaration)",
|
||||
}, AST_Symbol);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user