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

[directive-restrict] Finding ancestor functions assumes that all functions have names #517

Open
joelchoo opened this issue Nov 24, 2017 · 0 comments

Comments

@joelchoo
Copy link
Contributor

joelchoo commented Nov 24, 2017

Crashes when finding ancestor functions if ancestor function does not have a name.

Can reproduce by linting the following file:

export default function () {
  return {
    restrict: 'E',
  }
}

Error message and stack trace are:

Cannot read property 'name' of null
TypeError: Cannot read property 'name' of null
    at ./node_modules/eslint-plugin-angular/rules/directive-restrict.js:62:50
    at Array.some (<anonymous>)
    at checkLiteralNode (./node_modules/eslint-plugin-angular/rules/directive-restrict.js:59:40)
    at Property (./node_modules/eslint-plugin-angular/rules/directive-restrict.js:143:17)
    at listeners.(anonymous function).forEach.listener (./node_modules/eslint/lib/util/safe-emitter.js:47:58)
    at Array.forEach (<anonymous>)
    at Object.emit (./node_modules/eslint/lib/util/safe-emitter.js:47:38)
    at NodeEventGenerator.applySelector (./node_modules/eslint/lib/util/node-event-generator.js:251:26)
    at NodeEventGenerator.applySelectors (./node_modules/eslint/lib/util/node-event-generator.js:280:22)
    at NodeEventGenerator.enterNode (./node_modules/eslint/lib/util/node-event-generator.js:299:14)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants