mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Update LKG
This commit is contained in:
+34
-34
@@ -82,7 +82,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 */
|
||||
@@ -3803,7 +3803,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;
|
||||
@@ -46184,8 +46186,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) {
|
||||
@@ -46301,7 +46302,7 @@ var ts;
|
||||
clearCachedInferences(inferences);
|
||||
}
|
||||
}
|
||||
inferenceMatch = true;
|
||||
inferencePriority = Math.min(inferencePriority, priority);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
@@ -46394,21 +46395,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;
|
||||
@@ -46478,10 +46473,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)) {
|
||||
@@ -46490,21 +46486,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);
|
||||
@@ -46608,7 +46604,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);
|
||||
@@ -101554,14 +101550,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];
|
||||
@@ -112217,7 +112217,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;
|
||||
|
||||
Reference in New Issue
Block a user