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

Fix error in 'use-brace-expansion' rule #3

Merged
merged 1 commit into from
Jan 16, 2017

Conversation

dwickern
Copy link
Contributor

The test fails with this error:

  1) use-brace-expansion valid { test: Ember.computed.filterBy('a', 'b', false) }:
     TypeError: e.value.split is not a function
      at CallExpression.node.arguments.filter.map.e (rules/use-brace-expansion.js:9:954)
      at Array.map (native)
      at EventEmitter.CallExpression (rules/use-brace-expansion.js:9:892)
      at NodeEventGenerator.enterNode (node_modules/eslint/lib/util/node-event-generator.js:39:22)
      at CodePathAnalyzer.enterNode (node_modules/eslint/lib/code-path-analysis/code-path-analyzer.js:607:23)
      at CommentEventGenerator.enterNode (node_modules/eslint/lib/util/comment-event-generator.js:97:23)
      at Controller.enter (node_modules/eslint/lib/eslint.js:928:36)
      at Controller.__execute (node_modules/estraverse/estraverse.js:397:31)

The rule fails on this AST node:

Node {
  type: 'Literal',
  start: 828,
  end: 833,
  loc:
   SourceLocation {
     start: Position { line: 25, column: 62 },
     end: Position { line: 25, column: 67 } },
  range: [ 828, 833 ],
  value: false,
  raw: 'false' }

The test fails with this error:
```
  1) use-brace-expansion valid { test: Ember.computed.filterBy('a', 'b', false) }:
     TypeError: e.value.split is not a function
      at CallExpression.node.arguments.filter.map.e (rules/use-brace-expansion.js:9:954)
      at Array.map (native)
      at EventEmitter.CallExpression (rules/use-brace-expansion.js:9:892)
      at NodeEventGenerator.enterNode (node_modules/eslint/lib/util/node-event-generator.js:39:22)
      at CodePathAnalyzer.enterNode (node_modules/eslint/lib/code-path-analysis/code-path-analyzer.js:607:23)
      at CommentEventGenerator.enterNode (node_modules/eslint/lib/util/comment-event-generator.js:97:23)
      at Controller.enter (node_modules/eslint/lib/eslint.js:928:36)
      at Controller.__execute (node_modules/estraverse/estraverse.js:397:31)
```

The rule fails on this AST node:
```
Node {
  type: 'Literal',
  start: 828,
  end: 833,
  loc:
   SourceLocation {
     start: Position { line: 25, column: 62 },
     end: Position { line: 25, column: 67 } },
  range: [ 828, 833 ],
  value: false,
  raw: 'false' }
```
@michalsnik
Copy link
Member

Good catch @dwickern ! Thanks :)

@michalsnik michalsnik merged commit 98c496e into ember-cli:master Jan 16, 2017
@michalsnik
Copy link
Member

Version v2.0.1 released with your patch 🎉

@Turbo87 Turbo87 added the bug label Nov 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants