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.1.0 to 0.1.1

7

lib/assignment.js

@@ -29,2 +29,9 @@

}
if (this.left.type !== 'Identifier') return;
this.variable = scope.resolveVariable(this.left);
if (this.variable) {
this.variable.assignments.push(this);
}
}

@@ -31,0 +38,0 @@

7

lib/scope.js

@@ -67,9 +67,2 @@ var estraverse = require('estraverse');

this.assignments.push(assignment);
if (assignment.left.type !== 'Identifier') return;
var variable = this.resolveVariable(assignment.left);
if (variable) {
variable.assignments.push(assignment);
}
};

@@ -76,0 +69,0 @@

16

package.json
{
"name": "ast-scope",
"version": "0.1.0",
"version": "0.1.1",
"description": "A JavaScript AST scope analyzer",
"keywords": [
"ast",
"esprima",
"scope",
"analyze"
],
"scripts": {
"test": "node_modules/.bin/mocha --reporter dot"
"test": "mocha --reporter dot"
},
"author": "",
"author": "Naoyuki Kanezawa <naoyuki.kanezawa@gmail.com>",
"license": "MIT",
"repository": {
"type": "git",
"url": "git://github.com/nkzawa/ast-scope.git"
},
"dependencies": {

@@ -11,0 +21,0 @@ "estraverse": "~1.5.0"

@@ -6,4 +6,19 @@ ast-scope

A JavaScript AST scope analyzer
A JavaScript AST scope analyzer. The module is heavily inspired by [escope](https://github.com/Constellation/escope).
The module is heavily inspired by [escope](https://github.com/Constellation/escope).
## Installation
$ npm install ast-scope
## Usage
```js
var esprima = require('esprima');
var as = require('ast-scope');
var ast = esprima.parse('var foo = function() {};');
var topScope = as.analyze(ast);
```
## License
MIT

Sorry, the diff of this file is not supported yet

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