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

JSDoc in interface with @ symbol causes node.getStart() to throw exception #164

Closed
soda0289 opened this issue Feb 20, 2017 · 1 comment
Closed
Labels

Comments

@soda0289
Copy link
Member

TypeScript: master
typescript-eslint-parser: ts-2.1
Eslint: 3.15

interface Test {
    /**
     * Comment Line 1
     * @whatever bar 
     */
    foo(bar);
}

What did you expect to happen?
It should parse

What happened?
Exception from typescript when calling node.start();

TypeError: Cannot read property 'text' of undefined
    at Object.getTokenPosOfNode (/home/reyad/Workspace/typescript-eslint-parser/node_modules/typescript/lib/typescript.js:6807:71)
    at TokenObject.TokenOrIdentifierObject.getStart (/home/reyad/Workspace/typescript-eslint-parser/node_modules/typescript/lib/typescript.js:81993:23)
    at convert (/home/reyad/Workspace/typescript-eslint-parser/lib/ast-converter.js:490:30)
    at convertChild (/home/reyad/Workspace/typescript-eslint-parser/lib/ast-converter.js:517:20)
    at /home/reyad/Workspace/typescript-eslint-parser/lib/ast-converter.js:699:39
    at Array.forEach (native)
    at deeplyCopy (/home/reyad/Workspace/typescript-eslint-parser/lib/ast-converter.js:692:16)
    at convert (/home/reyad/Workspace/typescript-eslint-parser/lib/ast-converter.js:2043:17)
    at convertChild (/home/reyad/Workspace/typescript-eslint-parser/lib/ast-converter.js:517:20)
    at Array.map (native)

@soda0289
Copy link
Member Author

This is not broken in typescript 2.0.6 but is broken in typescript version > 2.1

soda0289 added a commit to soda0289/typescript-eslint-parser that referenced this issue Feb 26, 2017
JSDoc property is not found on parsed ESTree nodes and should be
removed when parsing typescript nodes.
soda0289 added a commit to soda0289/typescript-eslint-parser that referenced this issue Feb 26, 2017
JSDoc property is not found on parsed ESTree nodes and should be
removed when parsing typescript nodes.
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