Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ast-scope

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ast-scope - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

3

lib/index.js

@@ -127,2 +127,5 @@

case 'MemberExpression':
if (node.computed) {
scope.reference(node.property);
}
break;

@@ -129,0 +132,0 @@

9

lib/scope.js
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"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc