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

Cannot read property 'expression' of undefined #249

Closed
@vjeux

Description

@vjeux

There are two tests in the typescript codebase that make typescript-eslint-parser throw:

../TypeScript/tests//cases/conformance/parser/ecmascript5/ErrorRecovery/ExtendsOrImplementsClauses/parserErrorRecovery_ExtendsOrImplementsClause1.ts: TypeError: Cannot read property 'expression' of undefined
    at convert (/Users/despairblue/git/prettier/node_modules/typescript-eslint-parser/lib/ast-converter.js:1580:79)
../TypeScript/tests//cases/conformance/parser/ecmascript5/ErrorRecovery/ExtendsOrImplementsClauses/parserErrorRecovery_ExtendsOrImplementsClause3.ts: TypeError: Cannot read property 'expression' of undefined
    at convert (/Users/despairblue/git/prettier/node_modules/typescript-eslint-parser/lib/ast-converter.js:1580:79)
    at convertChild (/Users/despairblue/git/prettier/node_modules/typescript-eslint-parser/lib/ast-converter.js:501:20)
    at /Users/despairblue/git/prettier/node_modules/typescript-eslint-parser/lib/ast-converter.js:746:46
    at Array.forEach (native)
    at convert (/Users/despairblue/git/prettier/node_modules/typescript-eslint-parser/lib/ast-converter.js:745:33)
    at module.exports (/Users/despairblue/git/prettier/node_modules/typescript-eslint-parser/lib/ast-converter.js:2089:18)
    at Object.parse (/Users/despairblue/git/prettier/node_modules/typescript-eslint-parser/parser.js:239:12)
    at parseWithTypeScript (/Users/despairblue/git/prettier/src/parser.js:58:17)
    at parse (/Users/despairblue/git/prettier/index.js:32:12)
    at format (/Users/despairblue/git/prettier/index.js:80:15)
    at formatWithShebang (/Users/despairblue/git/prettier/index.js:91:12)
    at Object.format (/Users/despairblue/git/prettier/index.js:105:12)

Was found in prettier/prettier#1480

Those are the only two crashes from typescript-eslint-parser of the entire run: https://gist.githubusercontent.com/despairblue/79e090660fbb4093b35ab3b24c617dfb/raw/99e47ad1e34c32ddd91c15315f3c4fb92fa37d65/errors

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions