Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no-this-before-super: Cannot read property "superCalled" of undefined #5894

Closed
nashe opened this issue Apr 19, 2016 · 2 comments

Comments

Projects
None yet
3 participants
@nashe
Copy link

commented Apr 19, 2016

Aloha,

What version of ESLint are you using?

Tried with v2.5.3, v.2.8.0 (in Atom using the global eslint).

What parser (default, Babel-ESLint, etc.) are you using?

Default?

Please show your full configuration:

{
    "extends": "eslint:recommended",
    "env": {
      "es6": true
    },
    "parserOptions": {
      "sourceType": "module"
    },
    "rules": {
       "indent": ["error", 2, {"SwitchCase": 1}]
    }
}

What did you do? Please include the actual source code causing the issue.

export class A extends Array {

  constructor() {
    return;
    this.x = 'x';
  }

}

What did you expect to happen?

No error message. The no-unreachable rule matched correctly.

What actually happened? Please include the actual, raw output from ESLint.

TypeError: Cannot read property 'superCalled' of undefined
    at isCalled (xxx/node_modules/eslint/lib/rules/no-this-before-super.js:65:38)
    at Array.every (native)
    at isBeforeCallOfSuper (xxx/node_modules/eslint/lib/rules/no-this-before-super.js:83:48)
    at EventEmitter.ThisExpression (xxx/node_modules/eslint/lib/rules/no-this-before-super.js:245:17)
    at emitOne (events.js:77:13)
    at EventEmitter.emit (events.js:169:7)
    at NodeEventGenerator.enterNode (xxx/node_modules/eslint/lib/util/node-event-generator.js:42:22)
    at CodePathAnalyzer.enterNode (xxx/node_modules/eslint/lib/code-path-analysis/code-path-analyzer.js:609:23)
    at CommentEventGenerator.enterNode (xxx//node_modules/eslint/lib/util/comment-event-generator.js:99:23)
    at Controller.traverser.traverse.enter (xxx/node_modules/eslint/lib/eslint.js:887:36)

@eslintbot eslintbot added the triage label Apr 19, 2016

@mysticatea mysticatea added bug rule accepted and removed triage labels Apr 19, 2016

@mysticatea mysticatea self-assigned this Apr 19, 2016

@mysticatea

This comment has been minimized.

Copy link
Member

commented Apr 19, 2016

Thank you for this issue.

I will fix it.

mysticatea added a commit that referenced this issue Apr 19, 2016

mysticatea added a commit that referenced this issue Apr 20, 2016

ilyavolodin added a commit that referenced this issue Apr 20, 2016

Merge pull request #5897 from eslint/no-this-before-super/fix-crash
Fix: `no-this-before-super` crash on unreachable paths (fixes #5894)
@nashe

This comment has been minimized.

Copy link
Author

commented Apr 20, 2016

Awesome, thanks!

@eslint eslint bot locked and limited conversation to collaborators Feb 6, 2018

@eslint eslint bot added the archived due to age label Feb 6, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.