Skip to content

NullRef on processing destructuring with target ES6 #2631

Description

@zhuravlikjb

Code:

var q;
    let [, a,, b,,,, s,,,] = q;
    a = s[1];
    b = s[2];    

compile with target=es6 => exception

Stacktrace:

C:\Users\Anton.Lobov\Desktop\ts-latest-github\TypeScript\built\local\tsc.js:2162
4
            if (name.kind === 65 /* Identifier */) {
                    ^
TypeError: Cannot read property 'kind' of undefined
    at checkGrammarNameInLetOrConstDeclarations (C:\Users\Anton.Lobov\Desktop\ts
-latest-github\TypeScript\built\local\tsc.js:21624:21)
    at checkGrammarNameInLetOrConstDeclarations (C:\Users\Anton.Lobov\Desktop\ts
-latest-github\TypeScript\built\local\tsc.js:21633:21)
    at checkGrammarVariableDeclaration (C:\Users\Anton.Lobov\Desktop\ts-latest-g
ithub\TypeScript\built\local\tsc.js:21620:43)
    at checkVariableDeclaration (C:\Users\Anton.Lobov\Desktop\ts-latest-github\T
ypeScript\built\local\tsc.js:18776:13)
    at checkSourceElement (C:\Users\Anton.Lobov\Desktop\ts-latest-github\TypeScr
ipt\built\local\tsc.js:20104:28)
    at Object.forEach (C:\Users\Anton.Lobov\Desktop\ts-latest-github\TypeScript\
built\local\tsc.js:680:30)
    at checkVariableStatement (C:\Users\Anton.Lobov\Desktop\ts-latest-github\Typ
eScript\built\local\tsc.js:18786:16)
    at checkSourceElement (C:\Users\Anton.Lobov\Desktop\ts-latest-github\TypeScr
ipt\built\local\tsc.js:20073:28)
    at Object.forEach (C:\Users\Anton.Lobov\Desktop\ts-latest-github\TypeScript\
built\local\tsc.js:680:30)
    at checkSourceFileWorker (C:\Users\Anton.Lobov\Desktop\ts-latest-github\Type
Script\built\local\tsc.js:20238:20)

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions