Skip to content

Commit

Permalink
Update LKG
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Lichtman committed Aug 27, 2019
1 parent f28bdb4 commit 8118bec
Show file tree
Hide file tree
Showing 9 changed files with 188 additions and 195 deletions.
43 changes: 17 additions & 26 deletions lib/tsc.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
var ts;
(function (ts) {
ts.versionMajorMinor = "3.6";
ts.version = ts.versionMajorMinor + ".1-rc";
ts.version = ts.versionMajorMinor + ".2";
})(ts || (ts = {}));
(function (ts) {
ts.emptyArray = [];
Expand Down Expand Up @@ -38588,8 +38588,7 @@ var ts;
var visited;
var bivariant = false;
var propagationType;
var inferenceMatch = false;
var inferenceIncomplete = false;
var inferencePriority = 256;
var allowComplexConstraintInference = true;
inferFromTypes(originalSource, originalTarget);
function inferFromTypes(source, target) {
Expand Down Expand Up @@ -38679,7 +38678,7 @@ var ts;
clearCachedInferences(inferences);
}
}
inferenceMatch = true;
inferencePriority = Math.min(inferencePriority, priority);
return;
}
else {
Expand Down Expand Up @@ -38757,21 +38756,15 @@ var ts;
var key = source.id + "," + target.id;
var status = visited && visited.get(key);
if (status !== undefined) {
if (status & 1)
inferenceMatch = true;
if (status & 2)
inferenceIncomplete = true;
inferencePriority = Math.min(inferencePriority, status);
return;
}
(visited || (visited = ts.createMap())).set(key, 0);
var saveInferenceMatch = inferenceMatch;
var saveInferenceIncomplete = inferenceIncomplete;
inferenceMatch = false;
inferenceIncomplete = false;
(visited || (visited = ts.createMap())).set(key, -1);
var saveInferencePriority = inferencePriority;
inferencePriority = 256;
action(source, target);
visited.set(key, (inferenceMatch ? 1 : 0) | (inferenceIncomplete ? 2 : 0));
inferenceMatch = inferenceMatch || saveInferenceMatch;
inferenceIncomplete = inferenceIncomplete || saveInferenceIncomplete;
visited.set(key, inferencePriority);
inferencePriority = Math.min(inferencePriority, saveInferencePriority);
}
function inferFromMatchingType(source, targets, matches) {
var matched = false;
Expand Down Expand Up @@ -38841,8 +38834,7 @@ var ts;
var nakedTypeVariable = void 0;
var sources = source.flags & 1048576 ? source.types : [source];
var matched_1 = new Array(sources.length);
var saveInferenceIncomplete = inferenceIncomplete;
inferenceIncomplete = false;
var inferenceCircularity = false;
for (var _i = 0, targets_3 = targets; _i < targets_3.length; _i++) {
var t = targets_3[_i];
if (getInferenceInfoForType(t)) {
Expand All @@ -38851,18 +38843,17 @@ var ts;
}
else {
for (var i = 0; i < sources.length; i++) {
var saveInferenceMatch = inferenceMatch;
inferenceMatch = false;
var saveInferencePriority = inferencePriority;
inferencePriority = 256;
inferFromTypes(sources[i], t);
if (inferenceMatch)
if (inferencePriority === priority)
matched_1[i] = true;
inferenceMatch = inferenceMatch || saveInferenceMatch;
inferenceCircularity = inferenceCircularity || inferencePriority === -1;
inferencePriority = Math.min(inferencePriority, saveInferencePriority);
}
}
}
var inferenceComplete = !inferenceIncomplete;
inferenceIncomplete = inferenceIncomplete || saveInferenceIncomplete;
if (typeVariableCount === 1 && inferenceComplete) {
if (typeVariableCount === 1 && !inferenceCircularity) {
var unmatched = ts.flatMap(sources, function (s, i) { return matched_1[i] ? undefined : s; });
if (unmatched.length) {
inferFromTypes(getUnionType(unmatched), nakedTypeVariable);
Expand Down Expand Up @@ -38940,7 +38931,7 @@ var ts;
var symbol = isNonConstructorObject ? target.symbol : undefined;
if (symbol) {
if (ts.contains(symbolStack, symbol)) {
inferenceIncomplete = true;
inferencePriority = -1;
return;
}
(symbolStack || (symbolStack = [])).push(symbol);
Expand Down
68 changes: 34 additions & 34 deletions lib/tsserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ var ts;
// If changing the text in this section, be sure to test `configureNightly` too.
ts.versionMajorMinor = "3.6";
/** The version of the TypeScript compiler release */
ts.version = ts.versionMajorMinor + ".1-rc";
ts.version = ts.versionMajorMinor + ".2";
})(ts || (ts = {}));
(function (ts) {
/* @internal */
Expand Down Expand Up @@ -3815,7 +3815,9 @@ var ts;
InferencePriority[InferencePriority["LiteralKeyof"] = 32] = "LiteralKeyof";
InferencePriority[InferencePriority["NoConstraints"] = 64] = "NoConstraints";
InferencePriority[InferencePriority["AlwaysStrict"] = 128] = "AlwaysStrict";
InferencePriority[InferencePriority["MaxValue"] = 256] = "MaxValue";
InferencePriority[InferencePriority["PriorityImpliesCombination"] = 56] = "PriorityImpliesCombination";
InferencePriority[InferencePriority["Circularity"] = -1] = "Circularity";
})(InferencePriority = ts.InferencePriority || (ts.InferencePriority = {}));
/* @internal */
var InferenceFlags;
Expand Down Expand Up @@ -46196,8 +46198,7 @@ var ts;
var visited;
var bivariant = false;
var propagationType;
var inferenceMatch = false;
var inferenceIncomplete = false;
var inferencePriority = 256 /* MaxValue */;
var allowComplexConstraintInference = true;
inferFromTypes(originalSource, originalTarget);
function inferFromTypes(source, target) {
Expand Down Expand Up @@ -46313,7 +46314,7 @@ var ts;
clearCachedInferences(inferences);
}
}
inferenceMatch = true;
inferencePriority = Math.min(inferencePriority, priority);
return;
}
else {
Expand Down Expand Up @@ -46406,21 +46407,15 @@ var ts;
var key = source.id + "," + target.id;
var status = visited && visited.get(key);
if (status !== undefined) {
if (status & 1)
inferenceMatch = true;
if (status & 2)
inferenceIncomplete = true;
inferencePriority = Math.min(inferencePriority, status);
return;
}
(visited || (visited = ts.createMap())).set(key, 0);
var saveInferenceMatch = inferenceMatch;
var saveInferenceIncomplete = inferenceIncomplete;
inferenceMatch = false;
inferenceIncomplete = false;
(visited || (visited = ts.createMap())).set(key, -1 /* Circularity */);
var saveInferencePriority = inferencePriority;
inferencePriority = 256 /* MaxValue */;
action(source, target);
visited.set(key, (inferenceMatch ? 1 : 0) | (inferenceIncomplete ? 2 : 0));
inferenceMatch = inferenceMatch || saveInferenceMatch;
inferenceIncomplete = inferenceIncomplete || saveInferenceIncomplete;
visited.set(key, inferencePriority);
inferencePriority = Math.min(inferencePriority, saveInferencePriority);
}
function inferFromMatchingType(source, targets, matches) {
var matched = false;
Expand Down Expand Up @@ -46490,10 +46485,11 @@ var ts;
var nakedTypeVariable = void 0;
var sources = source.flags & 1048576 /* Union */ ? source.types : [source];
var matched_1 = new Array(sources.length);
var saveInferenceIncomplete = inferenceIncomplete;
inferenceIncomplete = false;
var inferenceCircularity = false;
// First infer to types that are not naked type variables. For each source type we
// track whether inferences were made from that particular type to some target.
// track whether inferences were made from that particular type to some target with
// equal priority (i.e. of equal quality) to what we would infer for a naked type
// parameter.
for (var _i = 0, targets_3 = targets; _i < targets_3.length; _i++) {
var t = targets_3[_i];
if (getInferenceInfoForType(t)) {
Expand All @@ -46502,21 +46498,21 @@ var ts;
}
else {
for (var i = 0; i < sources.length; i++) {
var saveInferenceMatch = inferenceMatch;
inferenceMatch = false;
var saveInferencePriority = inferencePriority;
inferencePriority = 256 /* MaxValue */;
inferFromTypes(sources[i], t);
if (inferenceMatch)
if (inferencePriority === priority)
matched_1[i] = true;
inferenceMatch = inferenceMatch || saveInferenceMatch;
inferenceCircularity = inferenceCircularity || inferencePriority === -1 /* Circularity */;
inferencePriority = Math.min(inferencePriority, saveInferencePriority);
}
}
}
var inferenceComplete = !inferenceIncomplete;
inferenceIncomplete = inferenceIncomplete || saveInferenceIncomplete;
// If the target has a single naked type variable and inference completed (meaning we
// explored the types fully), create a union of the source types from which no inferences
// have been made so far and infer from that union to the naked type variable.
if (typeVariableCount === 1 && inferenceComplete) {
// If the target has a single naked type variable and no inference circularities were
// encountered above (meaning we explored the types fully), create a union of the source
// types from which no inferences have been made so far and infer from that union to the
// naked type variable.
if (typeVariableCount === 1 && !inferenceCircularity) {
var unmatched = ts.flatMap(sources, function (s, i) { return matched_1[i] ? undefined : s; });
if (unmatched.length) {
inferFromTypes(getUnionType(unmatched), nakedTypeVariable);
Expand Down Expand Up @@ -46620,7 +46616,7 @@ var ts;
var symbol = isNonConstructorObject ? target.symbol : undefined;
if (symbol) {
if (ts.contains(symbolStack, symbol)) {
inferenceIncomplete = true;
inferencePriority = -1 /* Circularity */;
return;
}
(symbolStack || (symbolStack = [])).push(symbol);
Expand Down Expand Up @@ -101202,14 +101198,18 @@ var ts;
if (!match) {
return false;
}
// Limiting classification to exactly the elements and attributes
// defined in `ts.commentPragmas` would be excessive, but we can avoid
// some obvious false positives (e.g. in XML-like doc comments) by
// checking the element name.
if (!match[3] || !(match[3] in ts.commentPragmas)) {
return false;
}
var pos = start;
pushCommentRange(pos, match[1].length); // ///
pos += match[1].length;
pushClassification(pos, match[2].length, 10 /* punctuation */); // <
pos += match[2].length;
if (!match[3]) {
return true;
}
pushClassification(pos, match[3].length, 21 /* jsxSelfClosingTagName */); // element name
pos += match[3].length;
var attrText = match[4];
Expand Down Expand Up @@ -111865,7 +111865,7 @@ var ts;
// so pass --noResolve to avoid reporting missing file errors.
options.noResolve = true;
// if jsx is specified then treat file as .tsx
var inputFileName = transpileOptions.fileName || (options.jsx ? "module.tsx" : "module.ts");
var inputFileName = transpileOptions.fileName || (transpileOptions.compilerOptions && transpileOptions.compilerOptions.jsx ? "module.tsx" : "module.ts");
var sourceFile = ts.createSourceFile(inputFileName, input, options.target); // TODO: GH#18217
if (transpileOptions.moduleName) {
sourceFile.moduleName = transpileOptions.moduleName;
Expand Down
4 changes: 3 additions & 1 deletion lib/tsserverlibrary.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2441,7 +2441,9 @@ declare namespace ts {
LiteralKeyof = 32,
NoConstraints = 64,
AlwaysStrict = 128,
PriorityImpliesCombination = 56
MaxValue = 256,
PriorityImpliesCombination = 56,
Circularity = -1
}
/** @deprecated Use FileExtensionInfo instead. */
export type JsFileExtensionInfo = FileExtensionInfo;
Expand Down
Loading

0 comments on commit 8118bec

Please sign in to comment.