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

periscopic

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

periscopic - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

4

CHANGELOG.md
# periscopic changelog
## 1.0.1
* Only attach scope-creating nodes to the scope map
## 1.0.0
* First release

19

dist/periscopic.js

@@ -15,4 +15,2 @@ 'use strict';

let stack = [];
estreeWalker.walk(expression, {

@@ -27,5 +25,5 @@ enter(node, parent) {

scope.declarations.set(node.id.name, node);
scope = new Scope(scope, false);
map.set(node, scope = new Scope(scope, false));
} else {
scope = new Scope(scope, false);
map.set(node, scope = new Scope(scope, false));
if (node.id) scope.declarations.set(node.id.name, node);

@@ -40,9 +38,9 @@ }

} else if (/For(?:In|Of)?Statement/.test(node.type)) {
scope = new Scope(scope, true);
map.set(node, scope = new Scope(scope, true));
} else if (node.type === 'BlockStatement') {
scope = new Scope(scope, true);
map.set(node, scope = new Scope(scope, true));
} else if (/(Class|Variable)Declaration/.test(node.type)) {
add_declaration(scope, node);
} else if (node.type === 'CatchClause') {
scope = new Scope(scope, true);
map.set(node, scope = new Scope(scope, true));

@@ -55,9 +53,8 @@ extract_names(node.param).forEach(name => {

}
map.set(node, scope);
stack.push(scope);
},
leave(node) {
scope = stack.pop();
if (map.has(node)) {
scope = scope.parent;
}
}

@@ -64,0 +61,0 @@ });

{
"name": "periscopic",
"description": "periscopic",
"version": "1.0.0",
"version": "1.0.1",
"repository": "Rich-Harris/periscopic",

@@ -34,4 +34,4 @@ "main": "dist/periscopic.js",

"dependencies": {
"is-reference": "^1.1.3"
"is-reference": "^1.1.4"
}
}

@@ -19,3 +19,3 @@ # periscopic

* `map` is a `WeakMap<Node, Scope>`, where the keys are the nodes of your AST
* `map` is a `WeakMap<Node, Scope>`, where the keys are the nodes of your AST that create a scope
* `globals` is a `Set<string>` of all the identifiers that are referenced without being declared anywhere in the program (in this case, `b` and `console`)

@@ -22,0 +22,0 @@ * `scope` is the top-level `Scope` belonging to the program

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