Skip to content

Commit d68a936

Browse files
Update to TypeScript 3.3.3333.
1 parent ed08750 commit d68a936

File tree

10 files changed

+181
-49
lines changed

10 files changed

+181
-49
lines changed

tsserver/protocol.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2265,7 +2265,7 @@ declare namespace ts.server.protocol {
22652265
}
22662266
interface UserPreferences {
22672267
readonly disableSuggestions?: boolean;
2268-
readonly quotePreference?: "double" | "single";
2268+
readonly quotePreference?: "auto" | "double" | "single";
22692269
/**
22702270
* If enabled, TypeScript will search through all external modules' exports and add them to the completions list.
22712271
* This affects lone identifier completions but not completions on the right hand side of `obj.`.

tsserver/tsc.js

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
6161
var ts;
6262
(function (ts) {
6363
ts.versionMajorMinor = "3.3";
64-
ts.version = ts.versionMajorMinor + ".1";
64+
ts.version = ts.versionMajorMinor + ".3333";
6565
})(ts || (ts = {}));
6666
(function (ts) {
6767
ts.emptyArray = [];
@@ -22903,15 +22903,19 @@ var ts;
2290322903
flowAfterCatch = currentFlow;
2290422904
}
2290522905
if (node.finallyBlock) {
22906+
var preFinallyPrior = preTryFlow;
2290622907
if (!node.catchClause) {
2290722908
if (tryPriors.length) {
22909+
var preFinallyFlow_1 = createBranchLabel();
22910+
addAntecedent(preFinallyFlow_1, preTryFlow);
2290822911
for (var _a = 0, tryPriors_2 = tryPriors; _a < tryPriors_2.length; _a++) {
2290922912
var p = tryPriors_2[_a];
22910-
addAntecedent(preFinallyLabel, p);
22913+
addAntecedent(preFinallyFlow_1, p);
2291122914
}
22915+
preFinallyPrior = finishFlowLabel(preFinallyFlow_1);
2291222916
}
2291322917
}
22914-
var preFinallyFlow = { flags: 2048, antecedent: preTryFlow, lock: {} };
22918+
var preFinallyFlow = { flags: 2048, antecedent: preFinallyPrior, lock: {} };
2291522919
addAntecedent(preFinallyLabel, preFinallyFlow);
2291622920
currentFlow = finishFlowLabel(preFinallyLabel);
2291722921
bind(node.finallyBlock);
@@ -48476,7 +48480,7 @@ var ts;
4847648480
return;
4847748481
}
4847848482
var file = host.getSourceFile(resolvedDirective.resolvedFileName);
48479-
fileToDirective.set(file.path, key);
48483+
addReferencedFilesToTypeDirective(file, key);
4848048484
});
4848148485
}
4848248486
return {
@@ -48615,6 +48619,19 @@ var ts;
4861548619
}
4861648620
return false;
4861748621
}
48622+
function addReferencedFilesToTypeDirective(file, key) {
48623+
if (fileToDirective.has(file.path))
48624+
return;
48625+
fileToDirective.set(file.path, key);
48626+
for (var _i = 0, _a = file.referencedFiles; _i < _a.length; _i++) {
48627+
var fileName = _a[_i].fileName;
48628+
var resolvedFile = ts.resolveTripleslashReference(fileName, file.originalFileName);
48629+
var referencedFile = host.getSourceFile(resolvedFile);
48630+
if (referencedFile) {
48631+
addReferencedFilesToTypeDirective(referencedFile, key);
48632+
}
48633+
}
48634+
}
4861848635
}
4861948636
function getExternalModuleFileFromDeclaration(declaration) {
4862048637
var specifier = declaration.kind === 244 ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration);

tsserver/tsserver.js

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ var ts;
8888
// If changing the text in this section, be sure to test `configureNightly` too.
8989
ts.versionMajorMinor = "3.3";
9090
/** The version of the TypeScript compiler release */
91-
ts.version = ts.versionMajorMinor + ".1";
91+
ts.version = ts.versionMajorMinor + ".3333";
9292
})(ts || (ts = {}));
9393
(function (ts) {
9494
/* @internal */
@@ -28107,12 +28107,16 @@ var ts;
2810728107
// We add the nodes within the `try` block to the `finally`'s antecedents if there's no catch block
2810828108
// (If there is a `catch` block, it will have all these antecedents instead, and the `finally` will
2810928109
// have the end of the `try` block and the end of the `catch` block)
28110+
var preFinallyPrior = preTryFlow;
2811028111
if (!node.catchClause) {
2811128112
if (tryPriors.length) {
28113+
var preFinallyFlow_1 = createBranchLabel();
28114+
addAntecedent(preFinallyFlow_1, preTryFlow);
2811228115
for (var _a = 0, tryPriors_2 = tryPriors; _a < tryPriors_2.length; _a++) {
2811328116
var p = tryPriors_2[_a];
28114-
addAntecedent(preFinallyLabel, p);
28117+
addAntecedent(preFinallyFlow_1, p);
2811528118
}
28119+
preFinallyPrior = finishFlowLabel(preFinallyFlow_1);
2811628120
}
2811728121
}
2811828122
// in finally flow is combined from pre-try/flow from try/flow from catch
@@ -28141,7 +28145,7 @@ var ts;
2814128145
//
2814228146
// extra edges that we inject allows to control this behavior
2814328147
// if when walking the flow we step on post-finally edge - we can mark matching pre-finally edge as locked so it will be skipped.
28144-
var preFinallyFlow = { flags: 2048 /* PreFinally */, antecedent: preTryFlow, lock: {} };
28148+
var preFinallyFlow = { flags: 2048 /* PreFinally */, antecedent: preFinallyPrior, lock: {} };
2814528149
addAntecedent(preFinallyLabel, preFinallyFlow);
2814628150
currentFlow = finishFlowLabel(preFinallyLabel);
2814728151
bind(node.finallyBlock);
@@ -57874,7 +57878,9 @@ var ts;
5787457878
return;
5787557879
}
5787657880
var file = host.getSourceFile(resolvedDirective.resolvedFileName);
57877-
fileToDirective.set(file.path, key);
57881+
// Add the transitive closure of path references loaded by this file (as long as they are not)
57882+
// part of an existing type reference.
57883+
addReferencedFilesToTypeDirective(file, key);
5787857884
});
5787957885
}
5788057886
return {
@@ -58029,6 +58035,19 @@ var ts;
5802958035
}
5803058036
return false;
5803158037
}
58038+
function addReferencedFilesToTypeDirective(file, key) {
58039+
if (fileToDirective.has(file.path))
58040+
return;
58041+
fileToDirective.set(file.path, key);
58042+
for (var _i = 0, _a = file.referencedFiles; _i < _a.length; _i++) {
58043+
var fileName = _a[_i].fileName;
58044+
var resolvedFile = ts.resolveTripleslashReference(fileName, file.originalFileName);
58045+
var referencedFile = host.getSourceFile(resolvedFile);
58046+
if (referencedFile) {
58047+
addReferencedFilesToTypeDirective(referencedFile, key);
58048+
}
58049+
}
58050+
}
5803258051
}
5803358052
function getExternalModuleFileFromDeclaration(declaration) {
5803458053
var specifier = declaration.kind === 244 /* ModuleDeclaration */ ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration);
@@ -94462,7 +94481,7 @@ var ts;
9446294481
}
9446394482
ts.quotePreferenceFromString = quotePreferenceFromString;
9446494483
function getQuotePreference(sourceFile, preferences) {
94465-
if (preferences.quotePreference) {
94484+
if (preferences.quotePreference && preferences.quotePreference !== "auto") {
9446694485
return preferences.quotePreference === "single" ? 0 /* Single */ : 1 /* Double */;
9446794486
}
9446894487
else {
@@ -95033,15 +95052,18 @@ var ts;
9503395052
if (/^\d+$/.test(text)) {
9503495053
return text;
9503595054
}
95055+
// Editors can pass in undefined or empty string - we want to infer the preference in those cases.
95056+
var quotePreference = preferences.quotePreference || "auto";
9503695057
var quoted = JSON.stringify(text);
95037-
switch (preferences.quotePreference) {
95038-
case undefined:
95058+
switch (quotePreference) {
95059+
// TODO use getQuotePreference to infer the actual quote style.
95060+
case "auto":
9503995061
case "double":
9504095062
return quoted;
9504195063
case "single":
9504295064
return "'" + stripQuotes(quoted).replace("'", "\\'").replace('\\"', '"') + "'";
9504395065
default:
95044-
return ts.Debug.assertNever(preferences.quotePreference);
95066+
return ts.Debug.assertNever(quotePreference);
9504595067
}
9504695068
}
9504795069
ts.quote = quote;
@@ -113925,7 +113947,9 @@ var ts;
113925113947
}
113926113948
function createStubbedMethodBody(preferences) {
113927113949
return ts.createBlock([ts.createThrow(ts.createNew(ts.createIdentifier("Error"),
113928-
/*typeArguments*/ undefined, [ts.createLiteral("Method not implemented.", /*isSingleQuote*/ preferences.quotePreference === "single")]))],
113950+
/*typeArguments*/ undefined,
113951+
// TODO Handle auto quote preference.
113952+
[ts.createLiteral("Method not implemented.", /*isSingleQuote*/ preferences.quotePreference === "single")]))],
113929113953
/*multiline*/ true);
113930113954
}
113931113955
function createVisibilityModifier(flags) {

tsserver/tsserverlibrary.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3009,7 +3009,7 @@ declare namespace ts {
30093009
}
30103010
interface UserPreferences {
30113011
readonly disableSuggestions?: boolean;
3012-
readonly quotePreference?: "double" | "single";
3012+
readonly quotePreference?: "auto" | "double" | "single";
30133013
readonly includeCompletionsForModuleExports?: boolean;
30143014
readonly includeCompletionsWithInsertText?: boolean;
30153015
readonly importModuleSpecifierPreference?: "relative" | "non-relative";
@@ -7925,7 +7925,7 @@ declare namespace ts.server.protocol {
79257925
}
79267926
interface UserPreferences {
79277927
readonly disableSuggestions?: boolean;
7928-
readonly quotePreference?: "double" | "single";
7928+
readonly quotePreference?: "auto" | "double" | "single";
79297929
/**
79307930
* If enabled, TypeScript will search through all external modules' exports and add them to the completions list.
79317931
* This affects lone identifier completions but not completions on the right hand side of `obj.`.

tsserver/tsserverlibrary.js

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ var ts;
8484
// If changing the text in this section, be sure to test `configureNightly` too.
8585
ts.versionMajorMinor = "3.3";
8686
/** The version of the TypeScript compiler release */
87-
ts.version = ts.versionMajorMinor + ".1";
87+
ts.version = ts.versionMajorMinor + ".3333";
8888
})(ts || (ts = {}));
8989
(function (ts) {
9090
/* @internal */
@@ -28103,12 +28103,16 @@ var ts;
2810328103
// We add the nodes within the `try` block to the `finally`'s antecedents if there's no catch block
2810428104
// (If there is a `catch` block, it will have all these antecedents instead, and the `finally` will
2810528105
// have the end of the `try` block and the end of the `catch` block)
28106+
var preFinallyPrior = preTryFlow;
2810628107
if (!node.catchClause) {
2810728108
if (tryPriors.length) {
28109+
var preFinallyFlow_1 = createBranchLabel();
28110+
addAntecedent(preFinallyFlow_1, preTryFlow);
2810828111
for (var _a = 0, tryPriors_2 = tryPriors; _a < tryPriors_2.length; _a++) {
2810928112
var p = tryPriors_2[_a];
28110-
addAntecedent(preFinallyLabel, p);
28113+
addAntecedent(preFinallyFlow_1, p);
2811128114
}
28115+
preFinallyPrior = finishFlowLabel(preFinallyFlow_1);
2811228116
}
2811328117
}
2811428118
// in finally flow is combined from pre-try/flow from try/flow from catch
@@ -28137,7 +28141,7 @@ var ts;
2813728141
//
2813828142
// extra edges that we inject allows to control this behavior
2813928143
// if when walking the flow we step on post-finally edge - we can mark matching pre-finally edge as locked so it will be skipped.
28140-
var preFinallyFlow = { flags: 2048 /* PreFinally */, antecedent: preTryFlow, lock: {} };
28144+
var preFinallyFlow = { flags: 2048 /* PreFinally */, antecedent: preFinallyPrior, lock: {} };
2814128145
addAntecedent(preFinallyLabel, preFinallyFlow);
2814228146
currentFlow = finishFlowLabel(preFinallyLabel);
2814328147
bind(node.finallyBlock);
@@ -57870,7 +57874,9 @@ var ts;
5787057874
return;
5787157875
}
5787257876
var file = host.getSourceFile(resolvedDirective.resolvedFileName);
57873-
fileToDirective.set(file.path, key);
57877+
// Add the transitive closure of path references loaded by this file (as long as they are not)
57878+
// part of an existing type reference.
57879+
addReferencedFilesToTypeDirective(file, key);
5787457880
});
5787557881
}
5787657882
return {
@@ -58025,6 +58031,19 @@ var ts;
5802558031
}
5802658032
return false;
5802758033
}
58034+
function addReferencedFilesToTypeDirective(file, key) {
58035+
if (fileToDirective.has(file.path))
58036+
return;
58037+
fileToDirective.set(file.path, key);
58038+
for (var _i = 0, _a = file.referencedFiles; _i < _a.length; _i++) {
58039+
var fileName = _a[_i].fileName;
58040+
var resolvedFile = ts.resolveTripleslashReference(fileName, file.originalFileName);
58041+
var referencedFile = host.getSourceFile(resolvedFile);
58042+
if (referencedFile) {
58043+
addReferencedFilesToTypeDirective(referencedFile, key);
58044+
}
58045+
}
58046+
}
5802858047
}
5802958048
function getExternalModuleFileFromDeclaration(declaration) {
5803058049
var specifier = declaration.kind === 244 /* ModuleDeclaration */ ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration);
@@ -94772,7 +94791,7 @@ var ts;
9477294791
}
9477394792
ts.quotePreferenceFromString = quotePreferenceFromString;
9477494793
function getQuotePreference(sourceFile, preferences) {
94775-
if (preferences.quotePreference) {
94794+
if (preferences.quotePreference && preferences.quotePreference !== "auto") {
9477694795
return preferences.quotePreference === "single" ? 0 /* Single */ : 1 /* Double */;
9477794796
}
9477894797
else {
@@ -95343,15 +95362,18 @@ var ts;
9534395362
if (/^\d+$/.test(text)) {
9534495363
return text;
9534595364
}
95365+
// Editors can pass in undefined or empty string - we want to infer the preference in those cases.
95366+
var quotePreference = preferences.quotePreference || "auto";
9534695367
var quoted = JSON.stringify(text);
95347-
switch (preferences.quotePreference) {
95348-
case undefined:
95368+
switch (quotePreference) {
95369+
// TODO use getQuotePreference to infer the actual quote style.
95370+
case "auto":
9534995371
case "double":
9535095372
return quoted;
9535195373
case "single":
9535295374
return "'" + stripQuotes(quoted).replace("'", "\\'").replace('\\"', '"') + "'";
9535395375
default:
95354-
return ts.Debug.assertNever(preferences.quotePreference);
95376+
return ts.Debug.assertNever(quotePreference);
9535595377
}
9535695378
}
9535795379
ts.quote = quote;
@@ -114235,7 +114257,9 @@ var ts;
114235114257
}
114236114258
function createStubbedMethodBody(preferences) {
114237114259
return ts.createBlock([ts.createThrow(ts.createNew(ts.createIdentifier("Error"),
114238-
/*typeArguments*/ undefined, [ts.createLiteral("Method not implemented.", /*isSingleQuote*/ preferences.quotePreference === "single")]))],
114260+
/*typeArguments*/ undefined,
114261+
// TODO Handle auto quote preference.
114262+
[ts.createLiteral("Method not implemented.", /*isSingleQuote*/ preferences.quotePreference === "single")]))],
114239114263
/*multiline*/ true);
114240114264
}
114241114265
function createVisibilityModifier(flags) {

tsserver/typescript.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3009,7 +3009,7 @@ declare namespace ts {
30093009
}
30103010
interface UserPreferences {
30113011
readonly disableSuggestions?: boolean;
3012-
readonly quotePreference?: "double" | "single";
3012+
readonly quotePreference?: "auto" | "double" | "single";
30133013
readonly includeCompletionsForModuleExports?: boolean;
30143014
readonly includeCompletionsWithInsertText?: boolean;
30153015
readonly importModuleSpecifierPreference?: "relative" | "non-relative";

0 commit comments

Comments
 (0)