Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(compiler-cli): Pass SourceFile to getLeadingTriviaWidth #33588

Closed
wants to merge 1 commit into from

Commits on Nov 5, 2019

  1. fix(compiler-cli): Pass SourceFile to getLeadingTriviaWidth

    This commit fixes a crash in the Angular Kythe indexer caused by failure
    to retrieve `SourceFile` in a `Statement`.
    
    Crash logs:
      TypeError: Cannot read property 'text' of undefined
        at Object.getTokenPosOfNode (typescript/stable/lib/typescript.js:8957:72)
        at NodeObject.getStart (typescript/stable/lib/typescript.js:121419:23)
        at NodeObject.getLeadingTriviaWidth (typescript/stable/lib/typescript.js:121439:25)
        at FactoryGenerator.generate (angular2/rc/packages/compiler-cli/src/ngtsc/shims/src/factory_generator.ts:64:49)
        at GeneratedShimsHostWrapper.getSourceFile (angular2/rc/packages/compiler-cli/src/ngtsc/shims/src/host.ts:88:26)
        at findSourceFile (typescript/stable/lib/typescript.js:90654:29)
        at typescript/stable/lib/typescript.js:90553:85
        at getSourceFileFromReferenceWorker (typescript/stable/lib/typescript.js:90520:34)
        at processSourceFile (typescript/stable/lib/typescript.js:90553:13)
        at processRootFile (typescript/stable/lib/typescript.js:90383:13)
    kyliau committed Nov 5, 2019
    Copy the full SHA
    8a20ac3 View commit details
    Browse the repository at this point in the history