-
-
Notifications
You must be signed in to change notification settings - Fork 30
Conversation
0bd3b6b
to
fd857c5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for contributing!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
Will this have an effect on arrow functions with duplicate arguments? (duplicateName, duplicateName) => {} Duplicate argument names are disallowed in strict mode functions, and also in arrow functions. (Aside from duplicate arguments, I think there might be other features like this, but I'm not sure.) If the previous code was relying on arrow functions always being considered strict mode in order to implement those checks, then it might be necessary to do the checks explicitly now in order to preserve correct behavior. (I'm not very familiar with the |
I don't think |
Ok, sounds good. |
This reverts commit 2533966. The change is causing ESLint to crash with a parsing error on the following code: ```js console.log(this); z(x => console.log(x, this)) ``` ``` TypeError: Cannot read property 'length' of undefined at isStrictScope (/Users/tkatz/code/eslint/node_modules/eslint-scope/lib/scope.js:93:40) at new Scope (/Users/tkatz/code/eslint/node_modules/eslint-scope/lib/scope.js:254:25) at new FunctionScope (/Users/tkatz/code/eslint/node_modules/eslint-scope/lib/scope.js:641:9) at ScopeManager.__nestFunctionScope (/Users/tkatz/code/eslint/node_modules/eslint-scope/lib/scope-manager.js:209:33) at Referencer.visitFunction (/Users/tkatz/code/eslint/node_modules/eslint-scope/lib/referencer.js:200:27) at Referencer.ArrowFunctionExpression (/Users/tkatz/code/eslint/node_modules/eslint-scope/lib/referencer.js:567:14) at Referencer.Visitor.visit (/Users/tkatz/code/eslint/node_modules/esrecurse/esrecurse.js:104:34) at Referencer.Visitor.visitChildren (/Users/tkatz/code/eslint/node_modules/esrecurse/esrecurse.js:83:38) at Referencer.CallExpression (/Users/tkatz/code/eslint/node_modules/eslint-scope/lib/referencer.js:494:14) at Referencer.Visitor.visit (/Users/tkatz/code/eslint/node_modules/esrecurse/esrecurse.js:104:34) ``` Since this is currently affecting ESLint users, we're reverting the change for now until we figure out the root cause.
This reverts commit 2533966. The change is causing ESLint to crash with a parsing error on the following code: ```js console.log(this); z(x => console.log(x, this)) ``` ``` TypeError: Cannot read property 'length' of undefined at isStrictScope (/Users/tkatz/code/eslint/node_modules/eslint-scope/lib/scope.js:93:40) at new Scope (/Users/tkatz/code/eslint/node_modules/eslint-scope/lib/scope.js:254:25) at new FunctionScope (/Users/tkatz/code/eslint/node_modules/eslint-scope/lib/scope.js:641:9) at ScopeManager.__nestFunctionScope (/Users/tkatz/code/eslint/node_modules/eslint-scope/lib/scope-manager.js:209:33) at Referencer.visitFunction (/Users/tkatz/code/eslint/node_modules/eslint-scope/lib/referencer.js:200:27) at Referencer.ArrowFunctionExpression (/Users/tkatz/code/eslint/node_modules/eslint-scope/lib/referencer.js:567:14) at Referencer.Visitor.visit (/Users/tkatz/code/eslint/node_modules/esrecurse/esrecurse.js:104:34) at Referencer.Visitor.visitChildren (/Users/tkatz/code/eslint/node_modules/esrecurse/esrecurse.js:83:38) at Referencer.CallExpression (/Users/tkatz/code/eslint/node_modules/eslint-scope/lib/referencer.js:494:14) at Referencer.Visitor.visit (/Users/tkatz/code/eslint/node_modules/esrecurse/esrecurse.js:104:34) ``` Since this is currently affecting ESLint users, we're reverting the change for now until we figure out the root cause.
FYI, this change has been temporarily reverted because it was causing some crashes in ESLint. See #51 for more information. |
Fixes #49