New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

shift-scope

Package Overview
Dependencies
Maintainers
4
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shift-scope - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

2

dist/declaration.js

@@ -68,3 +68,3 @@ "use strict";

DeclarationType.CLASS_DECLARATION = new BlockScopedDeclaration("ClassDeclaration");
DeclarationType.CLASS_NAME = new BlockScopedDeclaration("ClassExpressionName");
DeclarationType.CLASS_NAME = new BlockScopedDeclaration("ClassName");
DeclarationType.PARAMETER = new FunctionScopedDeclaration("Parameter");

@@ -71,0 +71,0 @@ DeclarationType.CATCH_PARAMETER = new BlockScopedDeclaration("CatchParam");

@@ -110,2 +110,5 @@ "use strict";

value: function reduceBindingIdentifier(node) {
if (node.name == "*default*") {
return new _scopeState2.default();
}
return new _scopeState2.default({ bindingsForParent: [node] });

@@ -167,3 +170,4 @@ }

return _get(Object.getPrototypeOf(ScopeAnalyzer.prototype), "reduceClassDeclaration", this).call(this, node, { name: name.addDeclarations(_declaration.DeclarationType.CLASS_DECLARATION), super: _super, elements: elements });
var s = _get(Object.getPrototypeOf(ScopeAnalyzer.prototype), "reduceClassDeclaration", this).call(this, node, { name: name, super: _super, elements: elements }).addDeclarations(_declaration.DeclarationType.CLASS_NAME).finish(node, _scope.ScopeType.CLASS_NAME);
return s.concat(name.addDeclarations(_declaration.DeclarationType.CLASS_DECLARATION));
}

@@ -170,0 +174,0 @@ }, {

@@ -63,6 +63,7 @@ "use strict";

Assuming that the given node is defined in the scope, the map always returns at least one Variable.
It will return two in precisely two cases:
`try{}catch(e){var e = ...}`, and function declarations in blocks for which annex B.3.3 applies.
In this case the same identifier refers to two variables, one var-scoped and one block-scoped.
Both are returned, with the block-scoped variable being returned first. */
It will return two in precisely three cases:
`try{}catch(e){var e = ...}`, function declarations in blocks for which annex B.3.3 applies, and class declarations.
In this case the same identifier refers to two variables.
Both are returned, with the block-scoped variable being returned first in the first two cases, and the inner variable
being returned first in the third case. */
return this.variableMap.get(node);

@@ -69,0 +70,0 @@ }

@@ -147,2 +147,5 @@ "use strict";

value: function addFunctionDeclaration() {
if (this.bindingsForParent.length == 0) {
return this; // i.e., this function declaration is `export default function () {...}`
}
var binding = this.bindingsForParent[0];

@@ -255,2 +258,3 @@ var s = new ScopeState(this);

case _scope.ScopeType.FUNCTION_NAME:
case _scope.ScopeType.CLASS_NAME:
case _scope.ScopeType.PARAMETER_EXPRESSION:

@@ -257,0 +261,0 @@ // resolve references to only block-scoped free declarations

{
"name": "shift-scope",
"version": "2.0.0",
"version": "2.0.1",
"description": "produce a scope tree for Shift format ASTs",

@@ -5,0 +5,0 @@ "author": "Shape Security Labs",

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