Skip to content

Commit

Permalink
Bump version to 3.9.2 and LKG
Browse files Browse the repository at this point in the history
  • Loading branch information
typescript-bot committed May 8, 2020
1 parent 8bd8a88 commit 551f0dd
Show file tree
Hide file tree
Showing 8 changed files with 205 additions and 86 deletions.
43 changes: 29 additions & 14 deletions lib/tsc.js
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.1-rc";
ts.version = "3.9.2";
function tryGetNativeMap() {
return typeof Map !== "undefined" && "entries" in Map.prototype ? Map : undefined;
}
Expand Down Expand Up @@ -27221,18 +27221,17 @@ var ts;
if (ts.isIdentifier(node.left.expression) && container === file && isExportsOrModuleExportsOrAlias(file, node.left.expression)) {
bindExportsPropertyAssignment(node);
}
else if (ts.hasDynamicName(node)) {
bindAnonymousDeclaration(node, 4 | 67108864, "__computed");
var sym = bindPotentiallyMissingNamespaces(parentSymbol, node.left.expression, isTopLevelNamespaceAssignment(node.left), false, false);
addLateBoundAssignmentDeclarationToSymbol(node, sym);
}
else {
if (ts.hasDynamicName(node)) {
bindAnonymousDeclaration(node, 4 | 67108864, "__computed");
var sym = bindPotentiallyMissingNamespaces(parentSymbol, node.left.expression, isTopLevelNamespaceAssignment(node.left), false, false);
addLateBoundAssignmentDeclarationToSymbol(node, sym);
}
else {
bindStaticPropertyAssignment(ts.cast(node.left, ts.isBindableStaticAccessExpression));
}
bindStaticPropertyAssignment(ts.cast(node.left, ts.isBindableStaticNameExpression));
}
}
function bindStaticPropertyAssignment(node) {
ts.Debug.assert(!ts.isIdentifier(node));
node.expression.parent = node;
bindPropertyAssignment(node.expression, node, false, false);
}
Expand Down Expand Up @@ -29808,7 +29807,9 @@ var ts;
lastLocation === location.name && ts.isBindingPattern(lastLocation))) {
var root = ts.getRootDeclaration(location);
if (root.kind === 156) {
associatedDeclarationForContainingInitializerOrBindingName = location;
if (!associatedDeclarationForContainingInitializerOrBindingName) {
associatedDeclarationForContainingInitializerOrBindingName = location;
}
}
}
break;
Expand Down Expand Up @@ -32762,12 +32763,15 @@ var ts;
function getDeclarationWithTypeAnnotation(symbol, enclosingDeclaration) {
return symbol.declarations && ts.find(symbol.declarations, function (s) { return !!ts.getEffectiveTypeAnnotationNode(s) && (!enclosingDeclaration || !!ts.findAncestor(s, function (n) { return n === enclosingDeclaration; })); });
}
function existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type) {
return !(ts.getObjectFlags(type) & 4) || !ts.isTypeReferenceNode(existing) || ts.length(existing.typeArguments) >= getMinTypeArgumentCount(type.target.typeParameters);
}
function serializeTypeForDeclaration(context, type, symbol, enclosingDeclaration, includePrivateSymbol, bundled) {
if (type !== errorType && enclosingDeclaration) {
var declWithExistingAnnotation = getDeclarationWithTypeAnnotation(symbol, enclosingDeclaration);
if (declWithExistingAnnotation && !ts.isFunctionLikeDeclaration(declWithExistingAnnotation)) {
var existing = ts.getEffectiveTypeAnnotationNode(declWithExistingAnnotation);
if (getTypeFromTypeNode(existing) === type) {
if (getTypeFromTypeNode(existing) === type && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type)) {
var result_4 = serializeExistingTypeNode(context, existing, includePrivateSymbol, bundled);
if (result_4) {
return result_4;
Expand All @@ -32787,7 +32791,7 @@ var ts;
function serializeReturnTypeForSignature(context, type, signature, includePrivateSymbol, bundled) {
if (type !== errorType && context.enclosingDeclaration) {
var annotation = signature.declaration && ts.getEffectiveReturnTypeNode(signature.declaration);
if (!!ts.findAncestor(annotation, function (n) { return n === context.enclosingDeclaration; }) && annotation && instantiateType(getTypeFromTypeNode(annotation), signature.mapper) === type) {
if (!!ts.findAncestor(annotation, function (n) { return n === context.enclosingDeclaration; }) && annotation && instantiateType(getTypeFromTypeNode(annotation), signature.mapper) === type && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(annotation, type)) {
var result = serializeExistingTypeNode(context, annotation, includePrivateSymbol, bundled);
if (result) {
return result;
Expand Down Expand Up @@ -32826,6 +32830,14 @@ var ts;
if (ts.isJSDocVariadicType(node)) {
return ts.createArrayTypeNode(ts.visitNode(node.type, visitExistingNodeTreeSymbols));
}
if (ts.isJSDocTypeLiteral(node)) {
return ts.createTypeLiteralNode(ts.map(node.jsDocPropertyTags, function (t) {
var name = ts.isIdentifier(t.name) ? t.name : t.name.right;
var typeViaParent = getTypeOfPropertyOfType(getTypeFromTypeNode(node), name.escapedText);
var overrideTypeNode = typeViaParent && t.typeExpression && getTypeFromTypeNode(t.typeExpression.type) !== typeViaParent ? typeToTypeNodeHelper(typeViaParent, context) : undefined;
return ts.createPropertySignature(undefined, name, t.typeExpression && ts.isJSDocOptionalType(t.typeExpression.type) ? ts.createToken(57) : undefined, overrideTypeNode || (t.typeExpression && ts.visitNode(t.typeExpression.type, visitExistingNodeTreeSymbols)) || ts.createKeywordTypeNode(125), undefined);
}));
}
if (ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName) && node.typeName.escapedText === "") {
return ts.setOriginalNode(ts.createKeywordTypeNode(125), node);
}
Expand All @@ -32841,6 +32853,9 @@ var ts;
return ts.createFunctionTypeNode(ts.visitNodes(node.typeParameters, visitExistingNodeTreeSymbols), ts.map(node.parameters, function (p, i) { return ts.createParameter(undefined, undefined, getEffectiveDotDotDotForParameter(p), p.name || getEffectiveDotDotDotForParameter(p) ? "args" : "arg" + i, p.questionToken, ts.visitNode(p.type, visitExistingNodeTreeSymbols), undefined); }), ts.visitNode(node.type, visitExistingNodeTreeSymbols));
}
}
if (ts.isTypeReferenceNode(node) && ts.isInJSDoc(node) && (getIntendedTypeFromJSDocTypeReference(node) || unknownSymbol === resolveTypeReferenceName(getTypeReferenceName(node), 788968, true))) {
return ts.setOriginalNode(typeToTypeNodeHelper(getTypeFromTypeNode(node), context), node);
}
if (ts.isLiteralImportTypeNode(node)) {
return ts.updateImportTypeNode(node, ts.updateLiteralTypeNode(node.argument, rewriteModuleSpecifier(node, node.argument.literal)), node.qualifier, ts.visitNodes(node.typeArguments, visitExistingNodeTreeSymbols, ts.isTypeNode), node.isTypeOf);
}
Expand Down Expand Up @@ -40940,7 +40955,7 @@ var ts;
}
}
if (result && !inPropertyCheck && (target.flags & 2097152 && (isPerformingExcessPropertyChecks || isPerformingCommonPropertyChecks) ||
isNonGenericObjectType(target) && source.flags & 2097152 && getApparentType(source).flags & 3670016 && !ts.some(source.types, function (t) { return !!(ts.getObjectFlags(t) & 2097152); }))) {
isNonGenericObjectType(target) && !isArrayType(target) && !isTupleType(target) && source.flags & 2097152 && getApparentType(source).flags & 3670016 && !ts.some(source.types, function (t) { return !!(ts.getObjectFlags(t) & 2097152); }))) {
inPropertyCheck = true;
result &= recursiveTypeRelatedTo(source, target, reportErrors, 4);
inPropertyCheck = false;
Expand Down Expand Up @@ -44661,7 +44676,7 @@ var ts;
var predicate = getTypePredicateOfSignature(signature);
if (predicate && (predicate.kind === 2 || predicate.kind === 3)) {
var flowType = getTypeAtFlowNode(flow.antecedent);
var type = getTypeFromFlowType(flowType);
var type = finalizeEvolvingArrayType(getTypeFromFlowType(flowType));
var narrowedType = predicate.type ? narrowTypeByTypePredicate(type, predicate, flow.node, true) :
predicate.kind === 3 && predicate.parameterIndex >= 0 && predicate.parameterIndex < flow.node.arguments.length ? narrowTypeByAssertion(type, flow.node.arguments[predicate.parameterIndex]) :
type;
Expand Down

0 comments on commit 551f0dd

Please sign in to comment.