Comparing version 0.3.0 to 0.3.1
@@ -127,2 +127,5 @@ | ||
case 'MemberExpression': | ||
if (node.computed) { | ||
scope.reference(node.property); | ||
} | ||
break; | ||
@@ -129,0 +132,0 @@ |
var Variable = require('./variable'); | ||
var Assignment = require('./assignment'); | ||
var Reference = require('./reference'); | ||
var utils = require('./utils'); | ||
@@ -38,3 +39,3 @@ | ||
} else { | ||
name = node.name; | ||
name = utils.extractName(node); | ||
} | ||
@@ -66,6 +67,4 @@ | ||
case 'Identifier': | ||
name = node.name; | ||
break; | ||
case 'ThisExpression': | ||
name = 'this'; | ||
name = utils.extractName(node); | ||
break; | ||
@@ -89,3 +88,3 @@ default: | ||
if (typeof name !== 'string') { | ||
name = name.name; | ||
name = utils.extractName(name); | ||
} | ||
@@ -92,0 +91,0 @@ |
@@ -14,1 +14,10 @@ | ||
}; | ||
exports.extractName = function(node) { | ||
switch (node.type) { | ||
case 'Identifier': | ||
return node.name; | ||
case 'ThisExpression': | ||
return 'this'; | ||
} | ||
}; |
@@ -0,2 +1,4 @@ | ||
var utils = require('./utils'); | ||
module.exports = Variable; | ||
@@ -14,3 +16,3 @@ | ||
case 'ThisExpression': | ||
name = node.name; | ||
name = utils.extractName(node); | ||
break; | ||
@@ -17,0 +19,0 @@ default: |
{ | ||
"name": "ast-scope", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "A JavaScript AST scope analyzer", | ||
@@ -25,5 +25,5 @@ "keywords": [ | ||
"esprima": "~1.0.4", | ||
"mocha": "~1.17.1", | ||
"chai": "~1.9.0" | ||
"mocha": "~1.18.2", | ||
"chai": "~1.9.1" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13565
425