Skip to content

Commit 11b9f6e

Browse files
author
Yui T
committed
Wip-fix incremental parsing
1 parent 2721fd4 commit 11b9f6e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/compiler/parser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3700,7 +3700,7 @@ namespace ts {
37003700
// 3)we have a MemberExpression which either completes the LeftHandSideExpression,
37013701
// or starts the beginning of the first four CallExpression productions.
37023702
let expression: MemberExpression;
3703-
if (token() === SyntaxKind.ImportKeyword) {
3703+
if (token() === SyntaxKind.ImportKeyword && lookAhead(nextTokenIsOpenParenOrLessThan)) {
37043704
// We don't want to eagerly consume all import keyword as import call expression so we look a head to find "("
37053705
// For example:
37063706
// var foo3 = require("subfolder

src/compiler/program.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -802,6 +802,10 @@ namespace ts {
802802
// moduleAugmentations has changed
803803
oldProgram.structureIsReused = StructureIsReused.SafeModules;
804804
}
805+
if ((oldSourceFile.flags & NodeFlags.PossiblyContainsDynamicImport) !== (newSourceFile.flags & NodeFlags.PossiblyContainsDynamicImport)) {
806+
// dynamicImport has changed
807+
oldProgram.structureIsReused = StructureIsReused.Not;
808+
}
805809

806810
if (!arrayIsEqualTo(oldSourceFile.typeReferenceDirectives, newSourceFile.typeReferenceDirectives, fileReferenceIsEqualTo)) {
807811
// 'types' references has changed

0 commit comments

Comments
 (0)