Update LKG

This commit is contained in:
Mohamed Hegazy
2017-06-12 11:45:04 -07:00
parent 3af1894157
commit 14fa6ac8eb
7 changed files with 28 additions and 25 deletions
+1 -1
View File
@@ -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";
-1
View File
@@ -408,7 +408,6 @@ declare namespace ts {
JavaScriptFile = 65536,
ThisNodeOrAnySubNodesHasError = 131072,
HasAggregatedChildData = 262144,
PossiblyContainDynamicImport = 524288,
BlockScoped = 3,
ReachabilityCheckFlags = 384,
ReachabilityAndEmitFlags = 1408,
+1 -1
View File
@@ -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";
-1
View File
@@ -415,7 +415,6 @@ declare namespace ts {
JavaScriptFile = 65536,
ThisNodeOrAnySubNodesHasError = 131072,
HasAggregatedChildData = 262144,
PossiblyContainDynamicImport = 524288,
BlockScoped = 3,
ReachabilityCheckFlags = 384,
ReachabilityAndEmitFlags = 1408,
+13 -10
View File
@@ -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);
}
}
-1
View File
@@ -415,7 +415,6 @@ declare namespace ts {
JavaScriptFile = 65536,
ThisNodeOrAnySubNodesHasError = 131072,
HasAggregatedChildData = 262144,
PossiblyContainDynamicImport = 524288,
BlockScoped = 3,
ReachabilityCheckFlags = 384,
ReachabilityAndEmitFlags = 1408,
+13 -10
View File
@@ -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);
}
}