eslint-scope
Advanced tools
Comparing version 4.0.3 to 5.0.0
@@ -0,1 +1,6 @@ | ||
v5.0.0 - July 20, 2019 | ||
* [`e9fa22e`](https://github.com/eslint/eslint-scope/commit/e9fa22ea412c26cf2761fa98af7e715644bdb464) Upgrade: update dependencies after dropping support for Node <8 (#53) (Kai Cataldo) | ||
* [`ee9f7c1`](https://github.com/eslint/eslint-scope/commit/ee9f7c12721aa195ba7e0e69551f49bfdb479951) Breaking: drop support for Node v6 (#54) (Kai Cataldo) | ||
v4.0.3 - March 15, 2019 | ||
@@ -2,0 +7,0 @@ |
@@ -71,3 +71,3 @@ /* | ||
impliedStrict: false, | ||
sourceType: "script", // one of ['script', 'module'] | ||
sourceType: "script", // one of ['script', 'module'] | ||
ecmaVersion: 5, | ||
@@ -97,3 +97,3 @@ childVisitorKeys: null, | ||
for (const key in override) { | ||
if (override.hasOwnProperty(key)) { | ||
if (Object.prototype.hasOwnProperty.call(override, key)) { | ||
const val = override[key]; | ||
@@ -100,0 +100,0 @@ |
@@ -84,3 +84,3 @@ /* | ||
null | ||
)); | ||
)); | ||
}); | ||
@@ -155,3 +155,4 @@ } | ||
pattern !== assignment.left, | ||
init); | ||
init | ||
); | ||
}); | ||
@@ -161,11 +162,16 @@ } | ||
visitPattern(node, options, callback) { | ||
let visitPatternOptions = options; | ||
let visitPatternCallback = callback; | ||
if (typeof options === "function") { | ||
callback = options; | ||
options = { processRightHandNodes: false }; | ||
visitPatternCallback = options; | ||
visitPatternOptions = { processRightHandNodes: false }; | ||
} | ||
traverseIdentifierInPattern( | ||
this.options, | ||
node, | ||
options.processRightHandNodes ? this : null, | ||
callback); | ||
visitPatternOptions.processRightHandNodes ? this : null, | ||
visitPatternCallback | ||
); | ||
} | ||
@@ -186,10 +192,10 @@ | ||
this.currentScope().__define(node.id, | ||
new Definition( | ||
Variable.FunctionName, | ||
node.id, | ||
node, | ||
null, | ||
null, | ||
null | ||
)); | ||
new Definition( | ||
Variable.FunctionName, | ||
node.id, | ||
node, | ||
null, | ||
null, | ||
null | ||
)); | ||
} | ||
@@ -265,10 +271,10 @@ | ||
this.currentScope().__define(node.id, | ||
new Definition( | ||
Variable.ClassName, | ||
node.id, | ||
node, | ||
null, | ||
null, | ||
null | ||
)); | ||
new Definition( | ||
Variable.ClassName, | ||
node.id, | ||
node, | ||
null, | ||
null, | ||
null | ||
)); | ||
} | ||
@@ -282,7 +288,7 @@ | ||
this.currentScope().__define(node.id, | ||
new Definition( | ||
Variable.ClassName, | ||
node.id, | ||
node | ||
)); | ||
new Definition( | ||
Variable.ClassName, | ||
node.id, | ||
node | ||
)); | ||
} | ||
@@ -289,0 +295,0 @@ this.visit(node.body); |
@@ -164,3 +164,3 @@ /* | ||
/** | ||
/** | ||
* The scoped {@link Variable}s of this scope, as <code>{ Variable.name | ||
@@ -196,3 +196,3 @@ * : Variable }</code>. | ||
/** | ||
/** | ||
* The {@link Reference|references} that are not resolved with this scope. | ||
@@ -203,3 +203,3 @@ * @member {Reference[]} Scope#through | ||
/** | ||
/** | ||
* The scoped {@link Variable}s of this scope. In the case of a | ||
@@ -212,3 +212,3 @@ * 'function' scope this includes the automatic argument <em>arguments</em> as | ||
/** | ||
/** | ||
* Any variable {@link Reference|reference} found in this scope. This | ||
@@ -224,3 +224,3 @@ * includes occurrences of local variables as well as variables from | ||
/** | ||
/** | ||
* For 'global' and 'function' scopes, this is a self-reference. For | ||
@@ -234,3 +234,3 @@ * other scope types this is the <em>variableScope</em> value of the | ||
/** | ||
/** | ||
* Whether this scope is created by a FunctionExpression. | ||
@@ -241,3 +241,3 @@ * @member {boolean} Scope#functionExpressionScope | ||
/** | ||
/** | ||
* Whether this is a scope that contains an 'eval()' invocation. | ||
@@ -248,3 +248,3 @@ * @member {boolean} Scope#directCallToEvalScope | ||
/** | ||
/** | ||
* @member {boolean} Scope#thisFound | ||
@@ -256,3 +256,3 @@ */ | ||
/** | ||
/** | ||
* Reference to the parent {@link Scope|scope}. | ||
@@ -263,3 +263,3 @@ * @member {Scope} Scope#upper | ||
/** | ||
/** | ||
* Whether 'use strict' is in effect in this scope. | ||
@@ -270,3 +270,3 @@ * @member {boolean} Scope#isStrict | ||
/** | ||
/** | ||
* List of nested {@link Scope}s. | ||
@@ -428,7 +428,8 @@ * @member {Scope[]} Scope#childScopes | ||
this.__defineGeneric( | ||
node.name, | ||
this.set, | ||
this.variables, | ||
node, | ||
def); | ||
node.name, | ||
this.set, | ||
this.variables, | ||
node, | ||
def | ||
); | ||
} | ||
@@ -565,10 +566,10 @@ } | ||
this.__defineImplicit(info.pattern, | ||
new Definition( | ||
Variable.ImplicitGlobalVariable, | ||
info.pattern, | ||
info.node, | ||
null, | ||
null, | ||
null | ||
)); | ||
new Definition( | ||
Variable.ImplicitGlobalVariable, | ||
info.pattern, | ||
info.node, | ||
null, | ||
null, | ||
null | ||
)); | ||
@@ -585,7 +586,8 @@ } | ||
this.__defineGeneric( | ||
node.name, | ||
this.implicit.set, | ||
this.implicit.variables, | ||
node, | ||
def); | ||
node.name, | ||
this.implicit.set, | ||
this.implicit.variables, | ||
node, | ||
def | ||
); | ||
} | ||
@@ -605,10 +607,10 @@ } | ||
this.__define(block.id, | ||
new Definition( | ||
Variable.FunctionName, | ||
block.id, | ||
block, | ||
null, | ||
null, | ||
null | ||
)); | ||
new Definition( | ||
Variable.FunctionName, | ||
block.id, | ||
block, | ||
null, | ||
null, | ||
null | ||
)); | ||
this.functionExpressionScope = true; | ||
@@ -702,7 +704,8 @@ } | ||
this.__defineGeneric( | ||
"arguments", | ||
this.set, | ||
this.variables, | ||
null, | ||
null); | ||
"arguments", | ||
this.set, | ||
this.variables, | ||
null, | ||
null | ||
); | ||
this.taints.set("arguments", true); | ||
@@ -729,3 +732,3 @@ } | ||
variable.scope === this && | ||
ref.identifier.range[0] < bodyStart && // the reference is in the parameter part. | ||
ref.identifier.range[0] < bodyStart && // the reference is in the parameter part. | ||
variable.defs.every(d => d.name.range[0] >= bodyStart) // the variable is in the body. | ||
@@ -732,0 +735,0 @@ ); |
@@ -6,5 +6,5 @@ { | ||
"main": "lib/index.js", | ||
"version": "4.0.3", | ||
"version": "5.0.0", | ||
"engines": { | ||
"node": ">=4.0.0" | ||
"node": ">=8.0.0" | ||
}, | ||
@@ -35,14 +35,15 @@ "repository": "eslint/eslint-scope", | ||
"devDependencies": { | ||
"chai": "^3.4.1", | ||
"eslint": "^3.15.0", | ||
"eslint-config-eslint": "^4.0.0", | ||
"@typescript-eslint/parser": "^1.11.0", | ||
"chai": "^4.2.0", | ||
"eslint": "^6.0.1", | ||
"eslint-config-eslint": "^5.0.1", | ||
"eslint-plugin-node": "^9.1.0", | ||
"eslint-release": "^1.0.0", | ||
"espree": "^3.1.1", | ||
"espree": "^6.0.0", | ||
"istanbul": "^0.4.5", | ||
"mocha": "^3.2.0", | ||
"mocha": "^6.1.4", | ||
"npm-license": "^0.3.3", | ||
"shelljs": "^0.7.6", | ||
"typescript": "~2.0.10", | ||
"typescript-eslint-parser": "^1.0.0" | ||
"shelljs": "^0.8.3", | ||
"typescript": "^3.5.2" | ||
} | ||
} |
77338
1874
12