Skip to content

Compiler crash "Cannot read property 'emittedColumn' of undefined" #6637

@ajpalkovic

Description

@ajpalkovic

From the "release-1.8" branch, synced at 05803f5.

Repro:

typescript.transpileModule('var {x} = require("filename");', {
  compilerOptions: {
    sourceMap: true,
  },
});

Stack:

TypeError: Cannot read property 'emittedColumn' of undefined
    at encodeLastRecordedSourceMapSpan (third_party/TypeScript/1.8/typescript.js:30112:68)
    at emitPos (third_party/TypeScript/1.8/typescript.js:30162:17)
    at emitEnd (third_party/TypeScript/1.8/typescript.js:30189:13)
    at emitAssignment (third_party/TypeScript/1.8/typescript.js:35090:17)
    at emitBindingElement (third_party/TypeScript/1.8/typescript.js:35340:25)
    at emitBindingElement (third_party/TypeScript/1.8/typescript.js:35326:33)
    at emitDestructuring (third_party/TypeScript/1.8/typescript.js:35139:21)
    at emitVariableDeclaration (third_party/TypeScript/1.8/typescript.js:35348:25)
    at emitJavaScriptWorker (third_party/TypeScript/1.8/typescript.js:38642:32)
    at emitNodeWithoutSourceMap (third_party/TypeScript/1.8/typescript.js:38438:21)

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issueHigh Priority

    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