Skip to content

Commit 9f1a4f9

Browse files
Correct pluralization of 'Contain' to 'Contains', made the nodeflag internal.
1 parent a796817 commit 9f1a4f9

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

src/compiler/parser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ namespace ts {
484484
const newSourceFile = IncrementalParser.updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks);
485485
// Because new source file node is created, it may not have the flag PossiblyContainDynamicImport. This is the case if there is no new edit to add dynamic import.
486486
// We will manually port the flag to the new source file.
487-
newSourceFile.flags |= (sourceFile.flags & NodeFlags.PossiblyContainDynamicImport);
487+
newSourceFile.flags |= (sourceFile.flags & NodeFlags.PossiblyContainsDynamicImport);
488488
return newSourceFile;
489489
}
490490

@@ -3705,7 +3705,7 @@ namespace ts {
37053705
// For example:
37063706
// var foo3 = require("subfolder
37073707
// import * as foo1 from "module-from-node -> we want this import to be a statement rather than import call expression
3708-
sourceFile.flags |= NodeFlags.PossiblyContainDynamicImport;
3708+
sourceFile.flags |= NodeFlags.PossiblyContainsDynamicImport;
37093709
expression = parseTokenNode<PrimaryExpression>();
37103710
}
37113711
else {

src/compiler/program.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1379,7 +1379,7 @@ namespace ts {
13791379

13801380
for (const node of file.statements) {
13811381
collectModuleReferences(node, /*inAmbientModule*/ false);
1382-
if ((file.flags & NodeFlags.PossiblyContainDynamicImport) || isJavaScriptFile) {
1382+
if ((file.flags & NodeFlags.PossiblyContainsDynamicImport) || isJavaScriptFile) {
13831383
collectDynamicImportOrRequireCalls(node);
13841384
}
13851385
}

src/compiler/types.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -451,13 +451,14 @@ namespace ts {
451451
ThisNodeOrAnySubNodesHasError = 1 << 17, // If this node or any of its children had an error
452452
HasAggregatedChildData = 1 << 18, // If we've computed data from children and cached it in this node
453453

454-
// This flag will be set to true when the parse encounter dynamic import so that post-parsing process of module resolution
455-
// will not walk the tree if the flag is not set. However, this flag is just a approximation because once it is set, the flag never get reset.
456-
// (hence it is named "possiblyContainDynamicImport").
454+
// This flag will be set to true when the parser encounters a dynamic import expression so that post-parsing process of module resolution
455+
// will not walk the tree if the flag is not set. However, this flag is just a approximation because once it is set, the flag never gets reset.
456+
// (hence it is named "PossiblyContainsDynamicImport").
457457
// During editing, if dynamic import is remove, incremental parsing will *NOT* update this flag. This will then causes walking of the tree during module resolution.
458458
// However, the removal operation should not occur often and in the case of the removal, it is likely that users will add back the import anyway.
459459
// The advantage of this approach is its simplicity. For the case of batch compilation, we garuntee that users won't have to pay the price of walking the tree if dynamic import isn't used.
460-
PossiblyContainDynamicImport = 1 << 19,
460+
/* @internal */
461+
PossiblyContainsDynamicImport = 1 << 19,
461462

462463
BlockScoped = Let | Const,
463464

0 commit comments

Comments
 (0)