diff options
Diffstat (limited to 'lib/scope.js')
-rw-r--r-- | lib/scope.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/scope.js b/lib/scope.js index 97027274..799b0dc6 100644 --- a/lib/scope.js +++ b/lib/scope.js @@ -124,6 +124,19 @@ AST_Toplevel.DEFMETHOD("figure_out_scope", function(options) { var next_def_id = 0; var scope = self.parent_scope = null; var tw = new TreeWalker(function(node, descend) { + if (node instanceof AST_DefClass) { + var save_exported = exported; + exported = tw.parent() instanceof AST_ExportDeclaration; + node.name.walk(tw); + exported = save_exported; + walk_scope(function() { + if (node.extends) node.extends.walk(tw); + node.properties.forEach(function(prop) { + prop.walk(tw); + }); + }); + return true; + } if (node instanceof AST_Definitions) { var save_exported = exported; exported = tw.parent() instanceof AST_ExportDeclaration; |