Skip to content

Commit

Permalink
Do not create a scope reference for identifier in DotAccessor
Browse files Browse the repository at this point in the history
  • Loading branch information
rspivak committed Jun 6, 2011
1 parent 8aae166 commit 5be8228
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/slimit/tests/test_mangler.py
Expand Up @@ -81,9 +81,9 @@ class ManglerTestCase(unittest.TestCase):
var b = 'indeed', c = 5;
global_x = 56;
console.log(a + b);
new_result = function(d, e) {
var e = 'qwerty';
console.log(a + b + d + e + global_x);
new_result = function(c, d) {
var d = 'qwerty';
console.log(a + b + c + d + global_x);
};
};
"""),
Expand Down
4 changes: 4 additions & 0 deletions src/slimit/visitors/scopevisitor.py
Expand Up @@ -118,6 +118,10 @@ def visit_FuncDecl(self, node):
# alias
visit_FuncExpr = visit_FuncDecl

def visit_DotAccessor(self, node):
# we skip identifier
self.visit(node.node)

def visit_Identifier(self, node):
if getattr(node, 'scope', None) is not None:
self._fill_scope_refs(node.value, node.scope)
Expand Down

0 comments on commit 5be8228

Please sign in to comment.