Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.

Await node should have argument property not expression property #160

Closed
soda0289 opened this issue Feb 17, 2017 · 1 comment
Closed

Await node should have argument property not expression property #160

soda0289 opened this issue Feb 17, 2017 · 1 comment
Labels

Comments

@soda0289
Copy link
Member

Typescript: 2.1.6
Typescript-Eslint-Parser: ts-2.1
Eslint: v3.15.0

Code:

/* eslint no-extra-parens: error */
async function foo() {
    await 3;
}

What did you expect to happen?
Should parse

What happened?
Exception

Cannot read property 'type' of undefined
TypeError: Cannot read property 'type' of undefined
    at ruleApplies (C:\Users\reyad.attiyat\AppData\Roaming\npm\node_modules\eslint\lib\rules\no-extra-parens.js:78:21)
    at hasExcessParens (C:\Users\reyad.attiyat\AppData\Roaming\npm\node_modules\eslint\lib\rules\no-extra-parens.js:128:20)
    at EventEmitter.dryUnaryUpdate (C:\Users\reyad.attiyat\AppData\Roaming\npm\node_modules\eslint\lib\rules\no-extra-parens.js:374:17)
    at emitOne (events.js:77:13)
    at EventEmitter.emit (events.js:169:7)
    at NodeEventGenerator.enterNode (C:\Users\reyad.attiyat\AppData\Roaming\npm\node_modules\eslint\lib\util\node-event-generator.js:39:22)
    at CodePathAnalyzer.enterNode (C:\Users\reyad.attiyat\AppData\Roaming\npm\node_modules\eslint\lib\code-path-analysis\code-path-analyzer.js:607:23)
    at CommentEventGenerator.enterNode (C:\Users\reyad.attiyat\AppData\Roaming\npm\node_modules\eslint\lib\util\comment-event-generator.js:98:23)
    at Controller.enter (C:\Users\reyad.attiyat\AppData\Roaming\npm\node_modules\eslint\lib\eslint.js:928:36)
    at Controller.__execute (C:\Users\reyad.attiyat\AppData\Roaming\npm\node_modules\eslint\node_modules\estraverse\estraverse.js:397:31)

The await node should have an argument property not an expression property. Will submit PR.

soda0289 added a commit to soda0289/typescript-eslint-parser that referenced this issue Feb 17, 2017
The await node should have an argument property instead
of an express property to be a valid estree node.
soda0289 added a commit to soda0289/typescript-eslint-parser that referenced this issue Feb 17, 2017
The await node should have an argument property instead
of an expression property to be a valid estree node.
@soda0289
Copy link
Member Author

soda0289 added a commit to soda0289/typescript-eslint-parser that referenced this issue Feb 17, 2017
The await node should have an argument property instead
of an expression property to be a valid estree node.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants