Skip to content

Commit

Permalink
Bump version to 3.9.6 and LKG
Browse files Browse the repository at this point in the history
  • Loading branch information
TypeScript Bot committed Jun 30, 2020
1 parent 1ee1212 commit c6f9343
Show file tree
Hide file tree
Showing 8 changed files with 242 additions and 80 deletions.
53 changes: 40 additions & 13 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.9";
ts.version = "3.9.5";
ts.version = "3.9.6";
function tryGetNativeMap() {
return typeof Map !== "undefined" && "entries" in Map.prototype ? Map : undefined;
}
Expand Down Expand Up @@ -5022,6 +5022,7 @@ var ts;
Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0: diag(5081, ts.DiagnosticCategory.Error, "Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0_5081", "Cannot find a tsconfig.json file at the current directory: {0}."),
_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1: diag(5082, ts.DiagnosticCategory.Error, "_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1_5082", "'{0}' could be instantiated with an arbitrary type which could be unrelated to '{1}'."),
Cannot_read_file_0: diag(5083, ts.DiagnosticCategory.Error, "Cannot_read_file_0_5083", "Cannot read file '{0}'."),
The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialized_A_type_annotation_is_necessary: diag(5088, ts.DiagnosticCategory.Error, "The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialize_5088", "The inferred type of '{0}' references a type with a cyclic structure which cannot be trivially serialized. A type annotation is necessary."),
Generates_a_sourcemap_for_each_corresponding_d_ts_file: diag(6000, ts.DiagnosticCategory.Message, "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000", "Generates a sourcemap for each corresponding '.d.ts' file."),
Concatenate_and_emit_output_to_single_file: diag(6001, ts.DiagnosticCategory.Message, "Concatenate_and_emit_output_to_single_file_6001", "Concatenate and emit output to single file."),
Generates_corresponding_d_ts_file: diag(6002, ts.DiagnosticCategory.Message, "Generates_corresponding_d_ts_file_6002", "Generates corresponding '.d.ts' file."),
Expand Down Expand Up @@ -12287,7 +12288,7 @@ var ts;
if (!(name.kind === 154 || name.kind === 195)) {
return false;
}
var expr = ts.isElementAccessExpression(name) ? name.argumentExpression : name.expression;
var expr = ts.isElementAccessExpression(name) ? skipParentheses(name.argumentExpression) : name.expression;
return !isStringOrNumericLiteralLike(expr) &&
!isSignedNumericLiteral(expr) &&
!isWellKnownSymbolSyntactically(expr);
Expand Down Expand Up @@ -31818,15 +31819,29 @@ var ts;
context.inferTypeParameters = type.root.inferTypeParameters;
var extendsTypeNode = typeToTypeNodeHelper(type.extendsType, context);
context.inferTypeParameters = saveInferTypeParameters;
var trueTypeNode = typeToTypeNodeHelper(getTrueTypeFromConditionalType(type), context);
var falseTypeNode = typeToTypeNodeHelper(getFalseTypeFromConditionalType(type), context);
var trueTypeNode = typeToTypeNodeOrCircularityElision(getTrueTypeFromConditionalType(type));
var falseTypeNode = typeToTypeNodeOrCircularityElision(getFalseTypeFromConditionalType(type));
context.approximateLength += 15;
return ts.createConditionalTypeNode(checkTypeNode, extendsTypeNode, trueTypeNode, falseTypeNode);
}
if (type.flags & 33554432) {
return typeToTypeNodeHelper(type.baseType, context);
}
return ts.Debug.fail("Should be unreachable.");
function typeToTypeNodeOrCircularityElision(type) {
var _a, _b;
if (type.flags & 1048576) {
if (context.visitedTypes && context.visitedTypes.has("" + getTypeId(type))) {
if (!(context.flags & 131072)) {
context.encounteredError = true;
(_b = (_a = context.tracker) === null || _a === void 0 ? void 0 : _a.reportCyclicStructureError) === null || _b === void 0 ? void 0 : _b.call(_a);
}
return createElidedInformationPlaceholder(context);
}
return visitAndTransformType(type, function (type) { return typeToTypeNodeHelper(type, context); });
}
return typeToTypeNodeHelper(type, context);
}
function createMappedTypeNodeFromType(type) {
ts.Debug.assert(!!(type.flags & 524288));
var readonlyToken = type.declaration.readonlyToken ? ts.createToken(type.declaration.readonlyToken.kind) : undefined;
Expand Down Expand Up @@ -38485,10 +38500,12 @@ var ts;
}
return links.resolvedType;
}
function createIndexedAccessType(objectType, indexType) {
function createIndexedAccessType(objectType, indexType, aliasSymbol, aliasTypeArguments) {
var type = createType(8388608);
type.objectType = objectType;
type.indexType = indexType;
type.aliasSymbol = aliasSymbol;
type.aliasTypeArguments = aliasTypeArguments;
return type;
}
function isJSLiteralType(type) {
Expand Down Expand Up @@ -38762,10 +38779,10 @@ var ts;
var templateMapper = combineTypeMappers(objectType.mapper, mapper);
return instantiateType(getTemplateTypeFromMappedType(objectType), templateMapper);
}
function getIndexedAccessType(objectType, indexType, accessNode) {
return getIndexedAccessTypeOrUndefined(objectType, indexType, accessNode, 0) || (accessNode ? errorType : unknownType);
function getIndexedAccessType(objectType, indexType, accessNode, aliasSymbol, aliasTypeArguments) {
return getIndexedAccessTypeOrUndefined(objectType, indexType, accessNode, 0, aliasSymbol, aliasTypeArguments) || (accessNode ? errorType : unknownType);
}
function getIndexedAccessTypeOrUndefined(objectType, indexType, accessNode, accessFlags) {
function getIndexedAccessTypeOrUndefined(objectType, indexType, accessNode, accessFlags, aliasSymbol, aliasTypeArguments) {
if (accessFlags === void 0) { accessFlags = 0; }
if (objectType === wildcardType || indexType === wildcardType) {
return wildcardType;
Expand All @@ -38780,7 +38797,7 @@ var ts;
var id = objectType.id + "," + indexType.id;
var type = indexedAccessTypes.get(id);
if (!type) {
indexedAccessTypes.set(id, type = createIndexedAccessType(objectType, indexType));
indexedAccessTypes.set(id, type = createIndexedAccessType(objectType, indexType, aliasSymbol, aliasTypeArguments));
}
return type;
}
Expand All @@ -38804,7 +38821,7 @@ var ts;
if (wasMissingProp) {
return undefined;
}
return accessFlags & 2 ? getIntersectionType(propTypes) : getUnionType(propTypes);
return accessFlags & 2 ? getIntersectionType(propTypes, aliasSymbol, aliasTypeArguments) : getUnionType(propTypes, 1, aliasSymbol, aliasTypeArguments);
}
return getPropertyTypeForIndexType(objectType, apparentObjectType, indexType, indexType, false, accessNode, accessFlags | 4);
}
Expand All @@ -38813,7 +38830,8 @@ var ts;
if (!links.resolvedType) {
var objectType = getTypeFromTypeNode(node.objectType);
var indexType = getTypeFromTypeNode(node.indexType);
var resolved = getIndexedAccessType(objectType, indexType, node);
var potentialAlias = getAliasSymbolForTypeNode(node);
var resolved = getIndexedAccessType(objectType, indexType, node, potentialAlias, getTypeArgumentsForAliasSymbol(potentialAlias));
links.resolvedType = resolved.flags & 8388608 &&
resolved.objectType === objectType &&
resolved.indexType === indexType ?
Expand Down Expand Up @@ -39762,7 +39780,7 @@ var ts;
return getIndexType(instantiateType(type.type, mapper));
}
if (flags & 8388608) {
return getIndexedAccessType(instantiateType(type.objectType, mapper), instantiateType(type.indexType, mapper));
return getIndexedAccessType(instantiateType(type.objectType, mapper), instantiateType(type.indexType, mapper), undefined, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper));
}
if (flags & 16777216) {
return getConditionalTypeInstantiation(type, combineTypeMappers(type.mapper, mapper));
Expand Down Expand Up @@ -46242,6 +46260,9 @@ var ts;
return ts.Debug.assertNever(kind);
}
}
function isCircularMappedProperty(symbol) {
return !!(ts.getCheckFlags(symbol) & 262144 && !symbol.type && findResolutionCycleStartIndex(symbol, 0) >= 0);
}
function getTypeOfPropertyOfContextualType(type, name) {
return mapType(type, function (t) {
if (isGenericMappedType(t)) {
Expand All @@ -46255,7 +46276,7 @@ var ts;
else if (t.flags & 3670016) {
var prop = getPropertyOfType(t, name);
if (prop) {
return getTypeOfSymbol(prop);
return isCircularMappedProperty(prop) ? undefined : getTypeOfSymbol(prop);
}
if (isTupleType(t)) {
var restType = getRestTypeOfTupleType(t);
Expand Down Expand Up @@ -75534,6 +75555,7 @@ var ts;
trackSymbol: trackSymbol,
reportInaccessibleThisError: reportInaccessibleThisError,
reportInaccessibleUniqueSymbolError: reportInaccessibleUniqueSymbolError,
reportCyclicStructureError: reportCyclicStructureError,
reportPrivateInBaseOfClassExpression: reportPrivateInBaseOfClassExpression,
reportLikelyUnsafeImportRequiredError: reportLikelyUnsafeImportRequiredError,
moduleResolverHost: host,
Expand Down Expand Up @@ -75615,6 +75637,11 @@ var ts;
context.addDiagnostic(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary, ts.declarationNameToString(errorNameNode), "unique symbol"));
}
}
function reportCyclicStructureError() {
if (errorNameNode) {
context.addDiagnostic(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialized_A_type_annotation_is_necessary, ts.declarationNameToString(errorNameNode)));
}
}
function reportInaccessibleThisError() {
if (errorNameNode) {
context.addDiagnostic(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary, ts.declarationNameToString(errorNameNode), "this"));
Expand Down
Loading

0 comments on commit c6f9343

Please sign in to comment.