From 14fa6ac8eb5a8aed75865ee3a5a9f7caf6353aa2 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Mon, 12 Jun 2017 11:45:04 -0700 Subject: [PATCH] Update LKG --- lib/tsserver.js | 2 +- lib/tsserverlibrary.d.ts | 1 - lib/tsserverlibrary.js | 2 +- lib/typescript.d.ts | 1 - lib/typescript.js | 23 +++++++++++++---------- lib/typescriptServices.d.ts | 1 - lib/typescriptServices.js | 23 +++++++++++++---------- 7 files changed, 28 insertions(+), 25 deletions(-) diff --git a/lib/tsserver.js b/lib/tsserver.js index c3927968a71..ae66af0fe37 100644 --- a/lib/tsserver.js +++ b/lib/tsserver.js @@ -389,7 +389,7 @@ var ts; NodeFlags[NodeFlags["JavaScriptFile"] = 65536] = "JavaScriptFile"; NodeFlags[NodeFlags["ThisNodeOrAnySubNodesHasError"] = 131072] = "ThisNodeOrAnySubNodesHasError"; NodeFlags[NodeFlags["HasAggregatedChildData"] = 262144] = "HasAggregatedChildData"; - NodeFlags[NodeFlags["PossiblyContainDynamicImport"] = 524288] = "PossiblyContainDynamicImport"; + NodeFlags[NodeFlags["PossiblyContainsDynamicImport"] = 524288] = "PossiblyContainsDynamicImport"; NodeFlags[NodeFlags["BlockScoped"] = 3] = "BlockScoped"; NodeFlags[NodeFlags["ReachabilityCheckFlags"] = 384] = "ReachabilityCheckFlags"; NodeFlags[NodeFlags["ReachabilityAndEmitFlags"] = 1408] = "ReachabilityAndEmitFlags"; diff --git a/lib/tsserverlibrary.d.ts b/lib/tsserverlibrary.d.ts index 0e78276e369..48afba08f40 100644 --- a/lib/tsserverlibrary.d.ts +++ b/lib/tsserverlibrary.d.ts @@ -408,7 +408,6 @@ declare namespace ts { JavaScriptFile = 65536, ThisNodeOrAnySubNodesHasError = 131072, HasAggregatedChildData = 262144, - PossiblyContainDynamicImport = 524288, BlockScoped = 3, ReachabilityCheckFlags = 384, ReachabilityAndEmitFlags = 1408, diff --git a/lib/tsserverlibrary.js b/lib/tsserverlibrary.js index 521ff227791..eb4a2b0ca78 100644 --- a/lib/tsserverlibrary.js +++ b/lib/tsserverlibrary.js @@ -389,7 +389,7 @@ var ts; NodeFlags[NodeFlags["JavaScriptFile"] = 65536] = "JavaScriptFile"; NodeFlags[NodeFlags["ThisNodeOrAnySubNodesHasError"] = 131072] = "ThisNodeOrAnySubNodesHasError"; NodeFlags[NodeFlags["HasAggregatedChildData"] = 262144] = "HasAggregatedChildData"; - NodeFlags[NodeFlags["PossiblyContainDynamicImport"] = 524288] = "PossiblyContainDynamicImport"; + NodeFlags[NodeFlags["PossiblyContainsDynamicImport"] = 524288] = "PossiblyContainsDynamicImport"; NodeFlags[NodeFlags["BlockScoped"] = 3] = "BlockScoped"; NodeFlags[NodeFlags["ReachabilityCheckFlags"] = 384] = "ReachabilityCheckFlags"; NodeFlags[NodeFlags["ReachabilityAndEmitFlags"] = 1408] = "ReachabilityAndEmitFlags"; diff --git a/lib/typescript.d.ts b/lib/typescript.d.ts index 032b1ae0074..7a7489eea8a 100644 --- a/lib/typescript.d.ts +++ b/lib/typescript.d.ts @@ -415,7 +415,6 @@ declare namespace ts { JavaScriptFile = 65536, ThisNodeOrAnySubNodesHasError = 131072, HasAggregatedChildData = 262144, - PossiblyContainDynamicImport = 524288, BlockScoped = 3, ReachabilityCheckFlags = 384, ReachabilityAndEmitFlags = 1408, diff --git a/lib/typescript.js b/lib/typescript.js index ad8389377c0..712abadd7b1 100644 --- a/lib/typescript.js +++ b/lib/typescript.js @@ -424,13 +424,16 @@ var ts; NodeFlags[NodeFlags["JavaScriptFile"] = 65536] = "JavaScriptFile"; NodeFlags[NodeFlags["ThisNodeOrAnySubNodesHasError"] = 131072] = "ThisNodeOrAnySubNodesHasError"; NodeFlags[NodeFlags["HasAggregatedChildData"] = 262144] = "HasAggregatedChildData"; - // This flag will be set to true when the parse encounter dynamic import so that post-parsing process of module resolution - // 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. - // (hence it is named "possiblyContainDynamicImport"). - // 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. - // 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. - // 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. - NodeFlags[NodeFlags["PossiblyContainDynamicImport"] = 524288] = "PossiblyContainDynamicImport"; + // This flag will be set when the parser encounters a dynamic import expression so that module resolution + // will not have to 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 cleared (hence why it's named "PossiblyContainsDynamicImport"). + // During editing, if dynamic import is removed, incremental parsing will *NOT* update this flag. This means that the tree will always be traversed + // during module resolution. However, the removal operation should not occur often and in the case of the + // removal, it is likely that users will add the import anyway. + // The advantage of this approach is its simplicity. For the case of batch compilation, + // we guarantee that users won't have to pay the price of walking the tree if a dynamic import isn't used. + /* @internal */ + NodeFlags[NodeFlags["PossiblyContainsDynamicImport"] = 524288] = "PossiblyContainsDynamicImport"; NodeFlags[NodeFlags["BlockScoped"] = 3] = "BlockScoped"; NodeFlags[NodeFlags["ReachabilityCheckFlags"] = 384] = "ReachabilityCheckFlags"; NodeFlags[NodeFlags["ReachabilityAndEmitFlags"] = 1408] = "ReachabilityAndEmitFlags"; @@ -16304,7 +16307,7 @@ var ts; var newSourceFile = IncrementalParser.updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks); // 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. // We will manually port the flag to the new source file. - newSourceFile.flags |= (sourceFile.flags & 524288 /* PossiblyContainDynamicImport */); + newSourceFile.flags |= (sourceFile.flags & 524288 /* PossiblyContainsDynamicImport */); return newSourceFile; } ts.updateSourceFile = updateSourceFile; @@ -19111,7 +19114,7 @@ var ts; // For example: // var foo3 = require("subfolder // import * as foo1 from "module-from-node -> we want this import to be a statement rather than import call expression - sourceFile.flags |= 524288 /* PossiblyContainDynamicImport */; + sourceFile.flags |= 524288 /* PossiblyContainsDynamicImport */; expression = parseTokenNode(); } else { @@ -70034,7 +70037,7 @@ var ts; for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var node = _a[_i]; collectModuleReferences(node, /*inAmbientModule*/ false); - if ((file.flags & 524288 /* PossiblyContainDynamicImport */) || isJavaScriptFile) { + if ((file.flags & 524288 /* PossiblyContainsDynamicImport */) || isJavaScriptFile) { collectDynamicImportOrRequireCalls(node); } } diff --git a/lib/typescriptServices.d.ts b/lib/typescriptServices.d.ts index cef0059208f..6b7eb038e56 100644 --- a/lib/typescriptServices.d.ts +++ b/lib/typescriptServices.d.ts @@ -415,7 +415,6 @@ declare namespace ts { JavaScriptFile = 65536, ThisNodeOrAnySubNodesHasError = 131072, HasAggregatedChildData = 262144, - PossiblyContainDynamicImport = 524288, BlockScoped = 3, ReachabilityCheckFlags = 384, ReachabilityAndEmitFlags = 1408, diff --git a/lib/typescriptServices.js b/lib/typescriptServices.js index ad8389377c0..712abadd7b1 100644 --- a/lib/typescriptServices.js +++ b/lib/typescriptServices.js @@ -424,13 +424,16 @@ var ts; NodeFlags[NodeFlags["JavaScriptFile"] = 65536] = "JavaScriptFile"; NodeFlags[NodeFlags["ThisNodeOrAnySubNodesHasError"] = 131072] = "ThisNodeOrAnySubNodesHasError"; NodeFlags[NodeFlags["HasAggregatedChildData"] = 262144] = "HasAggregatedChildData"; - // This flag will be set to true when the parse encounter dynamic import so that post-parsing process of module resolution - // 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. - // (hence it is named "possiblyContainDynamicImport"). - // 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. - // 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. - // 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. - NodeFlags[NodeFlags["PossiblyContainDynamicImport"] = 524288] = "PossiblyContainDynamicImport"; + // This flag will be set when the parser encounters a dynamic import expression so that module resolution + // will not have to 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 cleared (hence why it's named "PossiblyContainsDynamicImport"). + // During editing, if dynamic import is removed, incremental parsing will *NOT* update this flag. This means that the tree will always be traversed + // during module resolution. However, the removal operation should not occur often and in the case of the + // removal, it is likely that users will add the import anyway. + // The advantage of this approach is its simplicity. For the case of batch compilation, + // we guarantee that users won't have to pay the price of walking the tree if a dynamic import isn't used. + /* @internal */ + NodeFlags[NodeFlags["PossiblyContainsDynamicImport"] = 524288] = "PossiblyContainsDynamicImport"; NodeFlags[NodeFlags["BlockScoped"] = 3] = "BlockScoped"; NodeFlags[NodeFlags["ReachabilityCheckFlags"] = 384] = "ReachabilityCheckFlags"; NodeFlags[NodeFlags["ReachabilityAndEmitFlags"] = 1408] = "ReachabilityAndEmitFlags"; @@ -16304,7 +16307,7 @@ var ts; var newSourceFile = IncrementalParser.updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks); // 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. // We will manually port the flag to the new source file. - newSourceFile.flags |= (sourceFile.flags & 524288 /* PossiblyContainDynamicImport */); + newSourceFile.flags |= (sourceFile.flags & 524288 /* PossiblyContainsDynamicImport */); return newSourceFile; } ts.updateSourceFile = updateSourceFile; @@ -19111,7 +19114,7 @@ var ts; // For example: // var foo3 = require("subfolder // import * as foo1 from "module-from-node -> we want this import to be a statement rather than import call expression - sourceFile.flags |= 524288 /* PossiblyContainDynamicImport */; + sourceFile.flags |= 524288 /* PossiblyContainsDynamicImport */; expression = parseTokenNode(); } else { @@ -70034,7 +70037,7 @@ var ts; for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var node = _a[_i]; collectModuleReferences(node, /*inAmbientModule*/ false); - if ((file.flags & 524288 /* PossiblyContainDynamicImport */) || isJavaScriptFile) { + if ((file.flags & 524288 /* PossiblyContainsDynamicImport */) || isJavaScriptFile) { collectDynamicImportOrRequireCalls(node); } }