Skip to content

Commit a796817

Browse files
author
Kanchalai Tanglertsampan
committed
Update LKG
1 parent 4a6ae58 commit a796817

File tree

5 files changed

+70
-26
lines changed

5 files changed

+70
-26
lines changed

lib/tsc.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13418,7 +13418,9 @@ var ts;
1341813418
}
1341913419
ts.isExternalModule = isExternalModule;
1342013420
function updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks) {
13421-
return IncrementalParser.updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks);
13421+
var newSourceFile = IncrementalParser.updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks);
13422+
newSourceFile.flags |= (sourceFile.flags & 524288);
13423+
return newSourceFile;
1342213424
}
1342313425
ts.updateSourceFile = updateSourceFile;
1342413426
function parseIsolatedJSDocComment(content, start, length) {
@@ -48812,14 +48814,14 @@ var ts;
4881248814
}
4881348815
function visitImportCallExpression(node) {
4881448816
switch (compilerOptions.module) {
48815-
case ts.ModuleKind.CommonJS:
48816-
return transformImportCallExpressionCommonJS(node);
4881748817
case ts.ModuleKind.AMD:
4881848818
return transformImportCallExpressionAMD(node);
4881948819
case ts.ModuleKind.UMD:
4882048820
return transformImportCallExpressionUMD(node);
48821+
case ts.ModuleKind.CommonJS:
48822+
default:
48823+
return transformImportCallExpressionCommonJS(node);
4882148824
}
48822-
ts.Debug.fail("All supported module kind in this transformation step should have been handled");
4882348825
}
4882448826
function transformImportCallExpressionUMD(node) {
4882548827
needUMDDynamicImportHelper = true;

lib/tsserver.js

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15255,7 +15255,9 @@ var ts;
1525515255
}
1525615256
ts.isExternalModule = isExternalModule;
1525715257
function updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks) {
15258-
return IncrementalParser.updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks);
15258+
var newSourceFile = IncrementalParser.updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks);
15259+
newSourceFile.flags |= (sourceFile.flags & 524288);
15260+
return newSourceFile;
1525915261
}
1526015262
ts.updateSourceFile = updateSourceFile;
1526115263
function parseIsolatedJSDocComment(content, start, length) {
@@ -50162,14 +50164,14 @@ var ts;
5016250164
}
5016350165
function visitImportCallExpression(node) {
5016450166
switch (compilerOptions.module) {
50165-
case ts.ModuleKind.CommonJS:
50166-
return transformImportCallExpressionCommonJS(node);
5016750167
case ts.ModuleKind.AMD:
5016850168
return transformImportCallExpressionAMD(node);
5016950169
case ts.ModuleKind.UMD:
5017050170
return transformImportCallExpressionUMD(node);
50171+
case ts.ModuleKind.CommonJS:
50172+
default:
50173+
return transformImportCallExpressionCommonJS(node);
5017150174
}
50172-
ts.Debug.fail("All supported module kind in this transformation step should have been handled");
5017350175
}
5017450176
function transformImportCallExpressionUMD(node) {
5017550177
needUMDDynamicImportHelper = true;
@@ -67631,7 +67633,14 @@ var ts;
6763167633
var token = ts.scanner.getToken();
6763267634
if (token === 91) {
6763367635
token = nextToken();
67634-
if (token === 9) {
67636+
if (token === 19) {
67637+
token = nextToken();
67638+
if (token === 9) {
67639+
recordModuleName();
67640+
return true;
67641+
}
67642+
}
67643+
else if (token === 9) {
6763567644
recordModuleName();
6763667645
return true;
6763767646
}

lib/tsserverlibrary.js

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16646,7 +16646,9 @@ var ts;
1664616646
}
1664716647
ts.isExternalModule = isExternalModule;
1664816648
function updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks) {
16649-
return IncrementalParser.updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks);
16649+
var newSourceFile = IncrementalParser.updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks);
16650+
newSourceFile.flags |= (sourceFile.flags & 524288);
16651+
return newSourceFile;
1665016652
}
1665116653
ts.updateSourceFile = updateSourceFile;
1665216654
function parseIsolatedJSDocComment(content, start, length) {
@@ -51553,14 +51555,14 @@ var ts;
5155351555
}
5155451556
function visitImportCallExpression(node) {
5155551557
switch (compilerOptions.module) {
51556-
case ts.ModuleKind.CommonJS:
51557-
return transformImportCallExpressionCommonJS(node);
5155851558
case ts.ModuleKind.AMD:
5155951559
return transformImportCallExpressionAMD(node);
5156051560
case ts.ModuleKind.UMD:
5156151561
return transformImportCallExpressionUMD(node);
51562+
case ts.ModuleKind.CommonJS:
51563+
default:
51564+
return transformImportCallExpressionCommonJS(node);
5156251565
}
51563-
ts.Debug.fail("All supported module kind in this transformation step should have been handled");
5156451566
}
5156551567
function transformImportCallExpressionUMD(node) {
5156651568
needUMDDynamicImportHelper = true;
@@ -67631,7 +67633,14 @@ var ts;
6763167633
var token = ts.scanner.getToken();
6763267634
if (token === 91) {
6763367635
token = nextToken();
67634-
if (token === 9) {
67636+
if (token === 19) {
67637+
token = nextToken();
67638+
if (token === 9) {
67639+
recordModuleName();
67640+
return true;
67641+
}
67642+
}
67643+
else if (token === 9) {
6763567644
recordModuleName();
6763667645
return true;
6763767646
}

lib/typescript.js

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16301,7 +16301,11 @@ var ts;
1630116301
// becoming detached from any SourceFile). It is recommended that this SourceFile not
1630216302
// be used once 'update' is called on it.
1630316303
function updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks) {
16304-
return IncrementalParser.updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks);
16304+
var newSourceFile = IncrementalParser.updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks);
16305+
// 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.
16306+
// We will manually port the flag to the new source file.
16307+
newSourceFile.flags |= (sourceFile.flags & 524288 /* PossiblyContainDynamicImport */);
16308+
return newSourceFile;
1630516309
}
1630616310
ts.updateSourceFile = updateSourceFile;
1630716311
/* @internal */
@@ -61069,14 +61073,14 @@ var ts;
6106961073
}
6107061074
function visitImportCallExpression(node) {
6107161075
switch (compilerOptions.module) {
61072-
case ts.ModuleKind.CommonJS:
61073-
return transformImportCallExpressionCommonJS(node);
6107461076
case ts.ModuleKind.AMD:
6107561077
return transformImportCallExpressionAMD(node);
6107661078
case ts.ModuleKind.UMD:
6107761079
return transformImportCallExpressionUMD(node);
61080+
case ts.ModuleKind.CommonJS:
61081+
default:
61082+
return transformImportCallExpressionCommonJS(node);
6107861083
}
61079-
ts.Debug.fail("All supported module kind in this transformation step should have been handled");
6108061084
}
6108161085
function transformImportCallExpressionUMD(node) {
6108261086
// (function (factory) {
@@ -81521,7 +81525,15 @@ var ts;
8152181525
var token = ts.scanner.getToken();
8152281526
if (token === 91 /* ImportKeyword */) {
8152381527
token = nextToken();
81524-
if (token === 9 /* StringLiteral */) {
81528+
if (token === 19 /* OpenParenToken */) {
81529+
token = nextToken();
81530+
if (token === 9 /* StringLiteral */) {
81531+
// import("mod");
81532+
recordModuleName();
81533+
return true;
81534+
}
81535+
}
81536+
else if (token === 9 /* StringLiteral */) {
8152581537
// import "mod";
8152681538
recordModuleName();
8152781539
return true;
@@ -81705,7 +81717,7 @@ var ts;
8170581717
// import * as NS from "mod"
8170681718
// import d, {a, b as B} from "mod"
8170781719
// import i = require("mod");
81708-
//
81720+
// import("mod");
8170981721
// export * from "mod"
8171081722
// export {a as b} from "mod"
8171181723
// export import i = require("mod")

lib/typescriptServices.js

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16301,7 +16301,11 @@ var ts;
1630116301
// becoming detached from any SourceFile). It is recommended that this SourceFile not
1630216302
// be used once 'update' is called on it.
1630316303
function updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks) {
16304-
return IncrementalParser.updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks);
16304+
var newSourceFile = IncrementalParser.updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks);
16305+
// 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.
16306+
// We will manually port the flag to the new source file.
16307+
newSourceFile.flags |= (sourceFile.flags & 524288 /* PossiblyContainDynamicImport */);
16308+
return newSourceFile;
1630516309
}
1630616310
ts.updateSourceFile = updateSourceFile;
1630716311
/* @internal */
@@ -61069,14 +61073,14 @@ var ts;
6106961073
}
6107061074
function visitImportCallExpression(node) {
6107161075
switch (compilerOptions.module) {
61072-
case ts.ModuleKind.CommonJS:
61073-
return transformImportCallExpressionCommonJS(node);
6107461076
case ts.ModuleKind.AMD:
6107561077
return transformImportCallExpressionAMD(node);
6107661078
case ts.ModuleKind.UMD:
6107761079
return transformImportCallExpressionUMD(node);
61080+
case ts.ModuleKind.CommonJS:
61081+
default:
61082+
return transformImportCallExpressionCommonJS(node);
6107861083
}
61079-
ts.Debug.fail("All supported module kind in this transformation step should have been handled");
6108061084
}
6108161085
function transformImportCallExpressionUMD(node) {
6108261086
// (function (factory) {
@@ -81521,7 +81525,15 @@ var ts;
8152181525
var token = ts.scanner.getToken();
8152281526
if (token === 91 /* ImportKeyword */) {
8152381527
token = nextToken();
81524-
if (token === 9 /* StringLiteral */) {
81528+
if (token === 19 /* OpenParenToken */) {
81529+
token = nextToken();
81530+
if (token === 9 /* StringLiteral */) {
81531+
// import("mod");
81532+
recordModuleName();
81533+
return true;
81534+
}
81535+
}
81536+
else if (token === 9 /* StringLiteral */) {
8152581537
// import "mod";
8152681538
recordModuleName();
8152781539
return true;
@@ -81705,7 +81717,7 @@ var ts;
8170581717
// import * as NS from "mod"
8170681718
// import d, {a, b as B} from "mod"
8170781719
// import i = require("mod");
81708-
//
81720+
// import("mod");
8170981721
// export * from "mod"
8171081722
// export {a as b} from "mod"
8171181723
// export import i = require("mod")

0 commit comments

Comments
 (0)