Update LKG

This commit is contained in:
Daniel Rosenwasser
2018-04-06 17:13:38 -07:00
parent 82e54fda8e
commit 7deda06f64
6 changed files with 341 additions and 125 deletions

View File

@@ -170,7 +170,7 @@ var ts;
var ts;
(function (ts) {
ts.versionMajorMinor = "2.8";
ts.version = ts.versionMajorMinor + ".2";
ts.version = ts.versionMajorMinor + ".3";
})(ts || (ts = {}));
(function (ts) {
function isExternalModuleNameRelative(moduleName) {
@@ -21926,6 +21926,9 @@ var ts;
if (initializer) {
namespace = getSymbolOfNode(initializer);
}
if (!namespace) {
return undefined;
}
if (namespace.valueDeclaration &&
ts.isVariableDeclaration(namespace.valueDeclaration) &&
namespace.valueDeclaration.initializer &&
@@ -25267,14 +25270,22 @@ var ts;
return baseObjectType || baseIndexType ? getIndexedAccessType(baseObjectType || type.objectType, baseIndexType || type.indexType) : undefined;
}
function getDefaultConstraintOfConditionalType(type) {
return getUnionType([getTrueTypeFromConditionalType(type), getFalseTypeFromConditionalType(type)]);
if (!type.resolvedDefaultConstraint) {
var rootTrueType = type.root.trueType;
var rootTrueConstraint = rootTrueType.flags & 4194304 ? rootTrueType.substitute : rootTrueType;
type.resolvedDefaultConstraint = getUnionType([instantiateType(rootTrueConstraint, type.combinedMapper || type.mapper), getFalseTypeFromConditionalType(type)]);
}
return type.resolvedDefaultConstraint;
}
function getConstraintOfDistributiveConditionalType(type) {
if (type.root.isDistributive) {
var constraint = getConstraintOfType(type.checkType);
if (constraint) {
var mapper = createTypeMapper([type.root.checkType], [constraint]);
return getConditionalTypeInstantiation(type, combineTypeMappers(mapper, type.mapper));
var instantiated = getConditionalTypeInstantiation(type, combineTypeMappers(mapper, type.mapper));
if (!(instantiated.flags & 16384)) {
return instantiated;
}
}
}
return undefined;
@@ -26207,7 +26218,7 @@ var ts;
}
function getConstrainedTypeVariable(typeVariable, node) {
var constraints;
while (ts.isPartOfTypeNode(node)) {
while (node && !ts.isStatement(node)) {
var parent = node.parent;
if (parent.kind === 170 && node === parent.trueType) {
var constraint = getImpliedConstraint(typeVariable, parent.checkType, parent.extendsType);
@@ -26757,12 +26768,16 @@ var ts;
}
return links.resolvedType;
}
function getIndexTypeForGenericType(type) {
if (!type.resolvedIndexType) {
type.resolvedIndexType = createType(524288);
type.resolvedIndexType.type = type;
function getIndexTypeForGenericType(type, includeDeclaredTypes) {
var cacheLocation = includeDeclaredTypes ? "resolvedDeclaredIndexType" : "resolvedIndexType";
if (!type[cacheLocation]) {
type[cacheLocation] = createType(524288);
type[cacheLocation].type = type;
if (includeDeclaredTypes) {
type[cacheLocation].isDeclaredType = true;
}
}
return type.resolvedIndexType;
return type[cacheLocation];
}
function getLiteralTypeFromPropertyName(prop) {
var links = getSymbolLinks(getLateBoundSymbol(prop));
@@ -26778,16 +26793,20 @@ var ts;
}
return links.nameType;
}
function getLiteralTypeFromPropertyNames(type) {
return getUnionType(ts.map(getPropertiesOfType(type), getLiteralTypeFromPropertyName));
function isTypeString(type) {
return isTypeAssignableToKind(type, 524322);
}
function getIndexType(type) {
return type.flags & 262144 ? getUnionType(ts.map(type.types, function (t) { return getIndexType(t); })) :
maybeTypeOfKind(type, 7372800) ? getIndexTypeForGenericType(type) :
function getLiteralTypeFromPropertyNames(type, includeDeclaredTypes) {
var originalKeys = ts.map(getPropertiesOfType(type), getLiteralTypeFromPropertyName);
return getUnionType(includeDeclaredTypes ? originalKeys : ts.filter(originalKeys, isTypeString));
}
function getIndexType(type, includeDeclaredTypes) {
return type.flags & 262144 ? getUnionType(ts.map(type.types, function (t) { return getIndexType(t, includeDeclaredTypes); })) :
maybeTypeOfKind(type, 7372800) ? getIndexTypeForGenericType(type, includeDeclaredTypes) :
ts.getObjectFlags(type) & 32 ? getConstraintTypeFromMappedType(type) :
type === wildcardType ? wildcardType :
type.flags & 1 || getIndexInfoOfType(type, 0) ? stringType :
getLiteralTypeFromPropertyNames(type);
getLiteralTypeFromPropertyNames(type, includeDeclaredTypes);
}
function getIndexTypeOrString(type) {
var indexType = getIndexType(type);
@@ -27000,13 +27019,16 @@ var ts;
if (checkType === wildcardType || extendsType === wildcardType) {
return wildcardType;
}
if (!root.isDistributive || !maybeTypeOfKind(checkType, 7897088)) {
var combinedMapper = void 0;
if (root.inferTypeParameters) {
var context = createInferenceContext(root.inferTypeParameters, undefined, 0);
var isDeferred = root.isDistributive && maybeTypeOfKind(checkType, 7897088);
var combinedMapper;
if (root.inferTypeParameters) {
var context = createInferenceContext(root.inferTypeParameters, undefined, 0);
if (!isDeferred) {
inferTypes(context.inferences, checkType, extendsType, 32 | 64);
combinedMapper = combineTypeMappers(mapper, context);
}
combinedMapper = combineTypeMappers(mapper, context);
}
if (!isDeferred) {
if (checkType.flags & 1) {
return getUnionType([instantiateType(root.trueType, combinedMapper || mapper), instantiateType(root.falseType, mapper)]);
}
@@ -27024,6 +27046,7 @@ var ts;
result.checkType = erasedCheckType;
result.extendsType = extendsType;
result.mapper = mapper;
result.combinedMapper = combinedMapper;
result.aliasSymbol = root.aliasSymbol;
result.aliasTypeArguments = instantiateTypes(root.aliasTypeArguments, mapper);
return result;
@@ -27045,13 +27068,27 @@ var ts;
}
return result;
}
function isPossiblyReferencedInConditionalType(tp, node) {
if (isTypeParameterPossiblyReferenced(tp, node)) {
return true;
}
while (node) {
if (node.kind === 170) {
if (isTypeParameterPossiblyReferenced(tp, node.extendsType)) {
return true;
}
}
node = node.parent;
}
return false;
}
function getTypeFromConditionalTypeNode(node) {
var links = getNodeLinks(node);
if (!links.resolvedType) {
var checkType = getTypeFromTypeNode(node.checkType);
var aliasTypeArguments = getAliasTypeArgumentsForTypeNode(node);
var allOuterTypeParameters = getOuterTypeParameters(node, true);
var outerTypeParameters = aliasTypeArguments ? allOuterTypeParameters : ts.filter(allOuterTypeParameters, function (tp) { return isTypeParameterPossiblyReferenced(tp, node); });
var outerTypeParameters = aliasTypeArguments ? allOuterTypeParameters : ts.filter(allOuterTypeParameters, function (tp) { return isPossiblyReferencedInConditionalType(tp, node); });
var root = {
node: node,
checkType: checkType,
@@ -27507,6 +27544,10 @@ var ts;
}
return type;
}
function maybeTypeParameterReference(node) {
return !(node.kind === 145 ||
node.parent.kind === 161 && node.parent.typeArguments && node === node.parent.typeName);
}
function isTypeParameterPossiblyReferenced(tp, node) {
if (tp.symbol && tp.symbol.declarations && tp.symbol.declarations.length === 1) {
var container_2 = tp.symbol.declarations[0].parent;
@@ -27520,7 +27561,8 @@ var ts;
case 173:
return tp.isThisType;
case 71:
return !tp.isThisType && ts.isPartOfTypeNode(node) && getTypeFromTypeNode(node) === tp;
return !tp.isThisType && ts.isPartOfTypeNode(node) && maybeTypeParameterReference(node) &&
getTypeFromTypeNode(node) === tp;
case 164:
return true;
}
@@ -28481,7 +28523,7 @@ var ts;
}
var constraint = getConstraintForRelation(target.type);
if (constraint) {
if (result = isRelatedTo(source, getIndexType(constraint), reportErrors)) {
if (result = isRelatedTo(source, getIndexType(constraint, target.isDeclaredType), reportErrors)) {
return result;
}
}
@@ -36375,7 +36417,7 @@ var ts;
}
var objectType = type.objectType;
var indexType = type.indexType;
if (isTypeAssignableTo(indexType, getIndexType(objectType))) {
if (isTypeAssignableTo(indexType, getIndexType(objectType, true))) {
if (accessNode.kind === 184 && ts.isAssignmentTarget(accessNode) &&
ts.getObjectFlags(objectType) & 32 && getMappedTypeModifiers(objectType) & 1) {
error(accessNode, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType));

View File

@@ -1366,7 +1366,7 @@ var ts;
var ts;
(function (ts) {
ts.versionMajorMinor = "2.8";
ts.version = ts.versionMajorMinor + ".2";
ts.version = ts.versionMajorMinor + ".3";
})(ts || (ts = {}));
(function (ts) {
function isExternalModuleNameRelative(moduleName) {
@@ -23362,6 +23362,9 @@ var ts;
if (initializer) {
namespace = getSymbolOfNode(initializer);
}
if (!namespace) {
return undefined;
}
if (namespace.valueDeclaration &&
ts.isVariableDeclaration(namespace.valueDeclaration) &&
namespace.valueDeclaration.initializer &&
@@ -26703,14 +26706,22 @@ var ts;
return baseObjectType || baseIndexType ? getIndexedAccessType(baseObjectType || type.objectType, baseIndexType || type.indexType) : undefined;
}
function getDefaultConstraintOfConditionalType(type) {
return getUnionType([getTrueTypeFromConditionalType(type), getFalseTypeFromConditionalType(type)]);
if (!type.resolvedDefaultConstraint) {
var rootTrueType = type.root.trueType;
var rootTrueConstraint = rootTrueType.flags & 4194304 ? rootTrueType.substitute : rootTrueType;
type.resolvedDefaultConstraint = getUnionType([instantiateType(rootTrueConstraint, type.combinedMapper || type.mapper), getFalseTypeFromConditionalType(type)]);
}
return type.resolvedDefaultConstraint;
}
function getConstraintOfDistributiveConditionalType(type) {
if (type.root.isDistributive) {
var constraint = getConstraintOfType(type.checkType);
if (constraint) {
var mapper = createTypeMapper([type.root.checkType], [constraint]);
return getConditionalTypeInstantiation(type, combineTypeMappers(mapper, type.mapper));
var instantiated = getConditionalTypeInstantiation(type, combineTypeMappers(mapper, type.mapper));
if (!(instantiated.flags & 16384)) {
return instantiated;
}
}
}
return undefined;
@@ -27643,7 +27654,7 @@ var ts;
}
function getConstrainedTypeVariable(typeVariable, node) {
var constraints;
while (ts.isPartOfTypeNode(node)) {
while (node && !ts.isStatement(node)) {
var parent = node.parent;
if (parent.kind === 170 && node === parent.trueType) {
var constraint = getImpliedConstraint(typeVariable, parent.checkType, parent.extendsType);
@@ -28193,12 +28204,16 @@ var ts;
}
return links.resolvedType;
}
function getIndexTypeForGenericType(type) {
if (!type.resolvedIndexType) {
type.resolvedIndexType = createType(524288);
type.resolvedIndexType.type = type;
function getIndexTypeForGenericType(type, includeDeclaredTypes) {
var cacheLocation = includeDeclaredTypes ? "resolvedDeclaredIndexType" : "resolvedIndexType";
if (!type[cacheLocation]) {
type[cacheLocation] = createType(524288);
type[cacheLocation].type = type;
if (includeDeclaredTypes) {
type[cacheLocation].isDeclaredType = true;
}
}
return type.resolvedIndexType;
return type[cacheLocation];
}
function getLiteralTypeFromPropertyName(prop) {
var links = getSymbolLinks(getLateBoundSymbol(prop));
@@ -28214,16 +28229,20 @@ var ts;
}
return links.nameType;
}
function getLiteralTypeFromPropertyNames(type) {
return getUnionType(ts.map(getPropertiesOfType(type), getLiteralTypeFromPropertyName));
function isTypeString(type) {
return isTypeAssignableToKind(type, 524322);
}
function getIndexType(type) {
return type.flags & 262144 ? getUnionType(ts.map(type.types, function (t) { return getIndexType(t); })) :
maybeTypeOfKind(type, 7372800) ? getIndexTypeForGenericType(type) :
function getLiteralTypeFromPropertyNames(type, includeDeclaredTypes) {
var originalKeys = ts.map(getPropertiesOfType(type), getLiteralTypeFromPropertyName);
return getUnionType(includeDeclaredTypes ? originalKeys : ts.filter(originalKeys, isTypeString));
}
function getIndexType(type, includeDeclaredTypes) {
return type.flags & 262144 ? getUnionType(ts.map(type.types, function (t) { return getIndexType(t, includeDeclaredTypes); })) :
maybeTypeOfKind(type, 7372800) ? getIndexTypeForGenericType(type, includeDeclaredTypes) :
ts.getObjectFlags(type) & 32 ? getConstraintTypeFromMappedType(type) :
type === wildcardType ? wildcardType :
type.flags & 1 || getIndexInfoOfType(type, 0) ? stringType :
getLiteralTypeFromPropertyNames(type);
getLiteralTypeFromPropertyNames(type, includeDeclaredTypes);
}
function getIndexTypeOrString(type) {
var indexType = getIndexType(type);
@@ -28436,13 +28455,16 @@ var ts;
if (checkType === wildcardType || extendsType === wildcardType) {
return wildcardType;
}
if (!root.isDistributive || !maybeTypeOfKind(checkType, 7897088)) {
var combinedMapper = void 0;
if (root.inferTypeParameters) {
var context = createInferenceContext(root.inferTypeParameters, undefined, 0);
var isDeferred = root.isDistributive && maybeTypeOfKind(checkType, 7897088);
var combinedMapper;
if (root.inferTypeParameters) {
var context = createInferenceContext(root.inferTypeParameters, undefined, 0);
if (!isDeferred) {
inferTypes(context.inferences, checkType, extendsType, 32 | 64);
combinedMapper = combineTypeMappers(mapper, context);
}
combinedMapper = combineTypeMappers(mapper, context);
}
if (!isDeferred) {
if (checkType.flags & 1) {
return getUnionType([instantiateType(root.trueType, combinedMapper || mapper), instantiateType(root.falseType, mapper)]);
}
@@ -28460,6 +28482,7 @@ var ts;
result.checkType = erasedCheckType;
result.extendsType = extendsType;
result.mapper = mapper;
result.combinedMapper = combinedMapper;
result.aliasSymbol = root.aliasSymbol;
result.aliasTypeArguments = instantiateTypes(root.aliasTypeArguments, mapper);
return result;
@@ -28481,13 +28504,27 @@ var ts;
}
return result;
}
function isPossiblyReferencedInConditionalType(tp, node) {
if (isTypeParameterPossiblyReferenced(tp, node)) {
return true;
}
while (node) {
if (node.kind === 170) {
if (isTypeParameterPossiblyReferenced(tp, node.extendsType)) {
return true;
}
}
node = node.parent;
}
return false;
}
function getTypeFromConditionalTypeNode(node) {
var links = getNodeLinks(node);
if (!links.resolvedType) {
var checkType = getTypeFromTypeNode(node.checkType);
var aliasTypeArguments = getAliasTypeArgumentsForTypeNode(node);
var allOuterTypeParameters = getOuterTypeParameters(node, true);
var outerTypeParameters = aliasTypeArguments ? allOuterTypeParameters : ts.filter(allOuterTypeParameters, function (tp) { return isTypeParameterPossiblyReferenced(tp, node); });
var outerTypeParameters = aliasTypeArguments ? allOuterTypeParameters : ts.filter(allOuterTypeParameters, function (tp) { return isPossiblyReferencedInConditionalType(tp, node); });
var root = {
node: node,
checkType: checkType,
@@ -28943,6 +28980,10 @@ var ts;
}
return type;
}
function maybeTypeParameterReference(node) {
return !(node.kind === 145 ||
node.parent.kind === 161 && node.parent.typeArguments && node === node.parent.typeName);
}
function isTypeParameterPossiblyReferenced(tp, node) {
if (tp.symbol && tp.symbol.declarations && tp.symbol.declarations.length === 1) {
var container_2 = tp.symbol.declarations[0].parent;
@@ -28956,7 +28997,8 @@ var ts;
case 173:
return tp.isThisType;
case 71:
return !tp.isThisType && ts.isPartOfTypeNode(node) && getTypeFromTypeNode(node) === tp;
return !tp.isThisType && ts.isPartOfTypeNode(node) && maybeTypeParameterReference(node) &&
getTypeFromTypeNode(node) === tp;
case 164:
return true;
}
@@ -29917,7 +29959,7 @@ var ts;
}
var constraint = getConstraintForRelation(target.type);
if (constraint) {
if (result = isRelatedTo(source, getIndexType(constraint), reportErrors)) {
if (result = isRelatedTo(source, getIndexType(constraint, target.isDeclaredType), reportErrors)) {
return result;
}
}
@@ -37818,7 +37860,7 @@ var ts;
}
var objectType = type.objectType;
var indexType = type.indexType;
if (isTypeAssignableTo(indexType, getIndexType(objectType))) {
if (isTypeAssignableTo(indexType, getIndexType(objectType, true))) {
if (accessNode.kind === 184 && ts.isAssignmentTarget(accessNode) &&
ts.getObjectFlags(objectType) & 32 && getMappedTypeModifiers(objectType) & 1) {
error(accessNode, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType));
@@ -69226,7 +69268,7 @@ var ts;
isJsxInitializer = true;
break;
case 71:
if (previousToken !== parent.name) {
if (parent !== previousToken.parent && !parent.initializer) {
isJsxInitializer = previousToken;
}
}

View File

@@ -1605,7 +1605,7 @@ var ts;
// If changing the text in this section, be sure to test `configureNightly` too.
ts.versionMajorMinor = "2.8";
/** The version of the TypeScript compiler release */
ts.version = ts.versionMajorMinor + ".2";
ts.version = ts.versionMajorMinor + ".3";
})(ts || (ts = {}));
(function (ts) {
function isExternalModuleNameRelative(moduleName) {
@@ -29320,6 +29320,10 @@ var ts;
if (initializer) {
namespace = getSymbolOfNode(initializer);
}
// Currently, IIFEs may not have a symbol and we don't know about their contents. Give up in this case.
if (!namespace) {
return undefined;
}
if (namespace.valueDeclaration &&
ts.isVariableDeclaration(namespace.valueDeclaration) &&
namespace.valueDeclaration.initializer &&
@@ -33127,7 +33131,12 @@ var ts;
return baseObjectType || baseIndexType ? getIndexedAccessType(baseObjectType || type.objectType, baseIndexType || type.indexType) : undefined;
}
function getDefaultConstraintOfConditionalType(type) {
return getUnionType([getTrueTypeFromConditionalType(type), getFalseTypeFromConditionalType(type)]);
if (!type.resolvedDefaultConstraint) {
var rootTrueType = type.root.trueType;
var rootTrueConstraint = rootTrueType.flags & 4194304 /* Substitution */ ? rootTrueType.substitute : rootTrueType;
type.resolvedDefaultConstraint = getUnionType([instantiateType(rootTrueConstraint, type.combinedMapper || type.mapper), getFalseTypeFromConditionalType(type)]);
}
return type.resolvedDefaultConstraint;
}
function getConstraintOfDistributiveConditionalType(type) {
// Check if we have a conditional type of the form 'T extends U ? X : Y', where T is a constrained
@@ -33139,7 +33148,10 @@ var ts;
var constraint = getConstraintOfType(type.checkType);
if (constraint) {
var mapper = createTypeMapper([type.root.checkType], [constraint]);
return getConditionalTypeInstantiation(type, combineTypeMappers(mapper, type.mapper));
var instantiated = getConditionalTypeInstantiation(type, combineTypeMappers(mapper, type.mapper));
if (!(instantiated.flags & 16384 /* Never */)) {
return instantiated;
}
}
}
return undefined;
@@ -34204,7 +34216,7 @@ var ts;
}
function getConstrainedTypeVariable(typeVariable, node) {
var constraints;
while (ts.isPartOfTypeNode(node)) {
while (node && !ts.isStatement(node)) {
var parent = node.parent;
if (parent.kind === 170 /* ConditionalType */ && node === parent.trueType) {
var constraint = getImpliedConstraint(typeVariable, parent.checkType, parent.extendsType);
@@ -34809,12 +34821,16 @@ var ts;
}
return links.resolvedType;
}
function getIndexTypeForGenericType(type) {
if (!type.resolvedIndexType) {
type.resolvedIndexType = createType(524288 /* Index */);
type.resolvedIndexType.type = type;
function getIndexTypeForGenericType(type, includeDeclaredTypes) {
var cacheLocation = includeDeclaredTypes ? "resolvedDeclaredIndexType" : "resolvedIndexType";
if (!type[cacheLocation]) {
type[cacheLocation] = createType(524288 /* Index */);
type[cacheLocation].type = type;
if (includeDeclaredTypes) {
type[cacheLocation].isDeclaredType = true;
}
}
return type.resolvedIndexType;
return type[cacheLocation];
}
function getLiteralTypeFromPropertyName(prop) {
var links = getSymbolLinks(getLateBoundSymbol(prop));
@@ -34830,16 +34846,20 @@ var ts;
}
return links.nameType;
}
function getLiteralTypeFromPropertyNames(type) {
return getUnionType(ts.map(getPropertiesOfType(type), getLiteralTypeFromPropertyName));
function isTypeString(type) {
return isTypeAssignableToKind(type, 524322 /* StringLike */);
}
function getIndexType(type) {
return type.flags & 262144 /* Intersection */ ? getUnionType(ts.map(type.types, function (t) { return getIndexType(t); })) :
maybeTypeOfKind(type, 7372800 /* InstantiableNonPrimitive */) ? getIndexTypeForGenericType(type) :
function getLiteralTypeFromPropertyNames(type, includeDeclaredTypes) {
var originalKeys = ts.map(getPropertiesOfType(type), getLiteralTypeFromPropertyName);
return getUnionType(includeDeclaredTypes ? originalKeys : ts.filter(originalKeys, isTypeString));
}
function getIndexType(type, includeDeclaredTypes) {
return type.flags & 262144 /* Intersection */ ? getUnionType(ts.map(type.types, function (t) { return getIndexType(t, includeDeclaredTypes); })) :
maybeTypeOfKind(type, 7372800 /* InstantiableNonPrimitive */) ? getIndexTypeForGenericType(type, includeDeclaredTypes) :
ts.getObjectFlags(type) & 32 /* Mapped */ ? getConstraintTypeFromMappedType(type) :
type === wildcardType ? wildcardType :
type.flags & 1 /* Any */ || getIndexInfoOfType(type, 0 /* String */) ? stringType :
getLiteralTypeFromPropertyNames(type);
getLiteralTypeFromPropertyNames(type, includeDeclaredTypes);
}
function getIndexTypeOrString(type) {
var indexType = getIndexType(type);
@@ -35081,16 +35101,19 @@ var ts;
// If this is a distributive conditional type and the check type is generic we need to defer
// resolution of the conditional type such that a later instantiation will properly distribute
// over union types.
if (!root.isDistributive || !maybeTypeOfKind(checkType, 7897088 /* Instantiable */)) {
var combinedMapper = void 0;
if (root.inferTypeParameters) {
var context = createInferenceContext(root.inferTypeParameters, /*signature*/ undefined, 0 /* None */);
var isDeferred = root.isDistributive && maybeTypeOfKind(checkType, 7897088 /* Instantiable */);
var combinedMapper;
if (root.inferTypeParameters) {
var context = createInferenceContext(root.inferTypeParameters, /*signature*/ undefined, 0 /* None */);
if (!isDeferred) {
// We don't want inferences from constraints as they may cause us to eagerly resolve the
// conditional type instead of deferring resolution. Also, we always want strict function
// types rules (i.e. proper contravariance) for inferences.
inferTypes(context.inferences, checkType, extendsType, 32 /* NoConstraints */ | 64 /* AlwaysStrict */);
combinedMapper = combineTypeMappers(mapper, context);
}
combinedMapper = combineTypeMappers(mapper, context);
}
if (!isDeferred) {
// Return union of trueType and falseType for 'any' since it matches anything
if (checkType.flags & 1 /* Any */) {
return getUnionType([instantiateType(root.trueType, combinedMapper || mapper), instantiateType(root.falseType, mapper)]);
@@ -35119,6 +35142,7 @@ var ts;
result.checkType = erasedCheckType;
result.extendsType = extendsType;
result.mapper = mapper;
result.combinedMapper = combinedMapper;
result.aliasSymbol = root.aliasSymbol;
result.aliasTypeArguments = instantiateTypes(root.aliasTypeArguments, mapper);
return result;
@@ -35140,13 +35164,27 @@ var ts;
}
return result;
}
function isPossiblyReferencedInConditionalType(tp, node) {
if (isTypeParameterPossiblyReferenced(tp, node)) {
return true;
}
while (node) {
if (node.kind === 170 /* ConditionalType */) {
if (isTypeParameterPossiblyReferenced(tp, node.extendsType)) {
return true;
}
}
node = node.parent;
}
return false;
}
function getTypeFromConditionalTypeNode(node) {
var links = getNodeLinks(node);
if (!links.resolvedType) {
var checkType = getTypeFromTypeNode(node.checkType);
var aliasTypeArguments = getAliasTypeArgumentsForTypeNode(node);
var allOuterTypeParameters = getOuterTypeParameters(node, /*includeThisTypes*/ true);
var outerTypeParameters = aliasTypeArguments ? allOuterTypeParameters : ts.filter(allOuterTypeParameters, function (tp) { return isTypeParameterPossiblyReferenced(tp, node); });
var outerTypeParameters = aliasTypeArguments ? allOuterTypeParameters : ts.filter(allOuterTypeParameters, function (tp) { return isPossiblyReferencedInConditionalType(tp, node); });
var root = {
node: node,
checkType: checkType,
@@ -35642,6 +35680,10 @@ var ts;
}
return type;
}
function maybeTypeParameterReference(node) {
return !(node.kind === 145 /* QualifiedName */ ||
node.parent.kind === 161 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName);
}
function isTypeParameterPossiblyReferenced(tp, node) {
// If the type parameter doesn't have exactly one declaration, if there are invening statement blocks
// between the node and the type parameter declaration, if the node contains actual references to the
@@ -35658,7 +35700,8 @@ var ts;
case 173 /* ThisType */:
return tp.isThisType;
case 71 /* Identifier */:
return !tp.isThisType && ts.isPartOfTypeNode(node) && getTypeFromTypeNode(node) === tp;
return !tp.isThisType && ts.isPartOfTypeNode(node) && maybeTypeParameterReference(node) &&
getTypeFromTypeNode(node) === tp;
case 164 /* TypeQuery */:
return true;
}
@@ -36765,7 +36808,7 @@ var ts;
// constraint of T.
var constraint = getConstraintForRelation(target.type);
if (constraint) {
if (result = isRelatedTo(source, getIndexType(constraint), reportErrors)) {
if (result = isRelatedTo(source, getIndexType(constraint, target.isDeclaredType), reportErrors)) {
return result;
}
}
@@ -46313,7 +46356,7 @@ var ts;
// Check if the index type is assignable to 'keyof T' for the object type.
var objectType = type.objectType;
var indexType = type.indexType;
if (isTypeAssignableTo(indexType, getIndexType(objectType))) {
if (isTypeAssignableTo(indexType, getIndexType(objectType, /*includeDeclaredTypes*/ true))) {
if (accessNode.kind === 184 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) &&
ts.getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) {
error(accessNode, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType));
@@ -83753,7 +83796,8 @@ var ts;
isJsxInitializer = true;
break;
case 71 /* Identifier */:
if (previousToken !== parent.name) {
// For `<div x=[|f/**/|]`, `parent` will be `x` and `previousToken.parent` will be `f` (which is its own JsxAttribute)
if (parent !== previousToken.parent && !parent.initializer) {
isJsxInitializer = previousToken;
}
}

View File

@@ -1605,7 +1605,7 @@ var ts;
// If changing the text in this section, be sure to test `configureNightly` too.
ts.versionMajorMinor = "2.8";
/** The version of the TypeScript compiler release */
ts.version = ts.versionMajorMinor + ".2";
ts.version = ts.versionMajorMinor + ".3";
})(ts || (ts = {}));
(function (ts) {
function isExternalModuleNameRelative(moduleName) {
@@ -27283,6 +27283,10 @@ var ts;
if (initializer) {
namespace = getSymbolOfNode(initializer);
}
// Currently, IIFEs may not have a symbol and we don't know about their contents. Give up in this case.
if (!namespace) {
return undefined;
}
if (namespace.valueDeclaration &&
ts.isVariableDeclaration(namespace.valueDeclaration) &&
namespace.valueDeclaration.initializer &&
@@ -31090,7 +31094,12 @@ var ts;
return baseObjectType || baseIndexType ? getIndexedAccessType(baseObjectType || type.objectType, baseIndexType || type.indexType) : undefined;
}
function getDefaultConstraintOfConditionalType(type) {
return getUnionType([getTrueTypeFromConditionalType(type), getFalseTypeFromConditionalType(type)]);
if (!type.resolvedDefaultConstraint) {
var rootTrueType = type.root.trueType;
var rootTrueConstraint = rootTrueType.flags & 4194304 /* Substitution */ ? rootTrueType.substitute : rootTrueType;
type.resolvedDefaultConstraint = getUnionType([instantiateType(rootTrueConstraint, type.combinedMapper || type.mapper), getFalseTypeFromConditionalType(type)]);
}
return type.resolvedDefaultConstraint;
}
function getConstraintOfDistributiveConditionalType(type) {
// Check if we have a conditional type of the form 'T extends U ? X : Y', where T is a constrained
@@ -31102,7 +31111,10 @@ var ts;
var constraint = getConstraintOfType(type.checkType);
if (constraint) {
var mapper = createTypeMapper([type.root.checkType], [constraint]);
return getConditionalTypeInstantiation(type, combineTypeMappers(mapper, type.mapper));
var instantiated = getConditionalTypeInstantiation(type, combineTypeMappers(mapper, type.mapper));
if (!(instantiated.flags & 16384 /* Never */)) {
return instantiated;
}
}
}
return undefined;
@@ -32167,7 +32179,7 @@ var ts;
}
function getConstrainedTypeVariable(typeVariable, node) {
var constraints;
while (ts.isPartOfTypeNode(node)) {
while (node && !ts.isStatement(node)) {
var parent = node.parent;
if (parent.kind === 170 /* ConditionalType */ && node === parent.trueType) {
var constraint = getImpliedConstraint(typeVariable, parent.checkType, parent.extendsType);
@@ -32772,12 +32784,16 @@ var ts;
}
return links.resolvedType;
}
function getIndexTypeForGenericType(type) {
if (!type.resolvedIndexType) {
type.resolvedIndexType = createType(524288 /* Index */);
type.resolvedIndexType.type = type;
function getIndexTypeForGenericType(type, includeDeclaredTypes) {
var cacheLocation = includeDeclaredTypes ? "resolvedDeclaredIndexType" : "resolvedIndexType";
if (!type[cacheLocation]) {
type[cacheLocation] = createType(524288 /* Index */);
type[cacheLocation].type = type;
if (includeDeclaredTypes) {
type[cacheLocation].isDeclaredType = true;
}
}
return type.resolvedIndexType;
return type[cacheLocation];
}
function getLiteralTypeFromPropertyName(prop) {
var links = getSymbolLinks(getLateBoundSymbol(prop));
@@ -32793,16 +32809,20 @@ var ts;
}
return links.nameType;
}
function getLiteralTypeFromPropertyNames(type) {
return getUnionType(ts.map(getPropertiesOfType(type), getLiteralTypeFromPropertyName));
function isTypeString(type) {
return isTypeAssignableToKind(type, 524322 /* StringLike */);
}
function getIndexType(type) {
return type.flags & 262144 /* Intersection */ ? getUnionType(ts.map(type.types, function (t) { return getIndexType(t); })) :
maybeTypeOfKind(type, 7372800 /* InstantiableNonPrimitive */) ? getIndexTypeForGenericType(type) :
function getLiteralTypeFromPropertyNames(type, includeDeclaredTypes) {
var originalKeys = ts.map(getPropertiesOfType(type), getLiteralTypeFromPropertyName);
return getUnionType(includeDeclaredTypes ? originalKeys : ts.filter(originalKeys, isTypeString));
}
function getIndexType(type, includeDeclaredTypes) {
return type.flags & 262144 /* Intersection */ ? getUnionType(ts.map(type.types, function (t) { return getIndexType(t, includeDeclaredTypes); })) :
maybeTypeOfKind(type, 7372800 /* InstantiableNonPrimitive */) ? getIndexTypeForGenericType(type, includeDeclaredTypes) :
ts.getObjectFlags(type) & 32 /* Mapped */ ? getConstraintTypeFromMappedType(type) :
type === wildcardType ? wildcardType :
type.flags & 1 /* Any */ || getIndexInfoOfType(type, 0 /* String */) ? stringType :
getLiteralTypeFromPropertyNames(type);
getLiteralTypeFromPropertyNames(type, includeDeclaredTypes);
}
function getIndexTypeOrString(type) {
var indexType = getIndexType(type);
@@ -33044,16 +33064,19 @@ var ts;
// If this is a distributive conditional type and the check type is generic we need to defer
// resolution of the conditional type such that a later instantiation will properly distribute
// over union types.
if (!root.isDistributive || !maybeTypeOfKind(checkType, 7897088 /* Instantiable */)) {
var combinedMapper = void 0;
if (root.inferTypeParameters) {
var context = createInferenceContext(root.inferTypeParameters, /*signature*/ undefined, 0 /* None */);
var isDeferred = root.isDistributive && maybeTypeOfKind(checkType, 7897088 /* Instantiable */);
var combinedMapper;
if (root.inferTypeParameters) {
var context = createInferenceContext(root.inferTypeParameters, /*signature*/ undefined, 0 /* None */);
if (!isDeferred) {
// We don't want inferences from constraints as they may cause us to eagerly resolve the
// conditional type instead of deferring resolution. Also, we always want strict function
// types rules (i.e. proper contravariance) for inferences.
inferTypes(context.inferences, checkType, extendsType, 32 /* NoConstraints */ | 64 /* AlwaysStrict */);
combinedMapper = combineTypeMappers(mapper, context);
}
combinedMapper = combineTypeMappers(mapper, context);
}
if (!isDeferred) {
// Return union of trueType and falseType for 'any' since it matches anything
if (checkType.flags & 1 /* Any */) {
return getUnionType([instantiateType(root.trueType, combinedMapper || mapper), instantiateType(root.falseType, mapper)]);
@@ -33082,6 +33105,7 @@ var ts;
result.checkType = erasedCheckType;
result.extendsType = extendsType;
result.mapper = mapper;
result.combinedMapper = combinedMapper;
result.aliasSymbol = root.aliasSymbol;
result.aliasTypeArguments = instantiateTypes(root.aliasTypeArguments, mapper);
return result;
@@ -33103,13 +33127,27 @@ var ts;
}
return result;
}
function isPossiblyReferencedInConditionalType(tp, node) {
if (isTypeParameterPossiblyReferenced(tp, node)) {
return true;
}
while (node) {
if (node.kind === 170 /* ConditionalType */) {
if (isTypeParameterPossiblyReferenced(tp, node.extendsType)) {
return true;
}
}
node = node.parent;
}
return false;
}
function getTypeFromConditionalTypeNode(node) {
var links = getNodeLinks(node);
if (!links.resolvedType) {
var checkType = getTypeFromTypeNode(node.checkType);
var aliasTypeArguments = getAliasTypeArgumentsForTypeNode(node);
var allOuterTypeParameters = getOuterTypeParameters(node, /*includeThisTypes*/ true);
var outerTypeParameters = aliasTypeArguments ? allOuterTypeParameters : ts.filter(allOuterTypeParameters, function (tp) { return isTypeParameterPossiblyReferenced(tp, node); });
var outerTypeParameters = aliasTypeArguments ? allOuterTypeParameters : ts.filter(allOuterTypeParameters, function (tp) { return isPossiblyReferencedInConditionalType(tp, node); });
var root = {
node: node,
checkType: checkType,
@@ -33605,6 +33643,10 @@ var ts;
}
return type;
}
function maybeTypeParameterReference(node) {
return !(node.kind === 145 /* QualifiedName */ ||
node.parent.kind === 161 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName);
}
function isTypeParameterPossiblyReferenced(tp, node) {
// If the type parameter doesn't have exactly one declaration, if there are invening statement blocks
// between the node and the type parameter declaration, if the node contains actual references to the
@@ -33621,7 +33663,8 @@ var ts;
case 173 /* ThisType */:
return tp.isThisType;
case 71 /* Identifier */:
return !tp.isThisType && ts.isPartOfTypeNode(node) && getTypeFromTypeNode(node) === tp;
return !tp.isThisType && ts.isPartOfTypeNode(node) && maybeTypeParameterReference(node) &&
getTypeFromTypeNode(node) === tp;
case 164 /* TypeQuery */:
return true;
}
@@ -34728,7 +34771,7 @@ var ts;
// constraint of T.
var constraint = getConstraintForRelation(target.type);
if (constraint) {
if (result = isRelatedTo(source, getIndexType(constraint), reportErrors)) {
if (result = isRelatedTo(source, getIndexType(constraint, target.isDeclaredType), reportErrors)) {
return result;
}
}
@@ -44276,7 +44319,7 @@ var ts;
// Check if the index type is assignable to 'keyof T' for the object type.
var objectType = type.objectType;
var indexType = type.indexType;
if (isTypeAssignableTo(indexType, getIndexType(objectType))) {
if (isTypeAssignableTo(indexType, getIndexType(objectType, /*includeDeclaredTypes*/ true))) {
if (accessNode.kind === 184 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) &&
ts.getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) {
error(accessNode, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType));
@@ -85332,7 +85375,8 @@ var ts;
isJsxInitializer = true;
break;
case 71 /* Identifier */:
if (previousToken !== parent.name) {
// For `<div x=[|f/**/|]`, `parent` will be `x` and `previousToken.parent` will be `f` (which is its own JsxAttribute)
if (parent !== previousToken.parent && !parent.initializer) {
isJsxInitializer = previousToken;
}
}

View File

@@ -1605,7 +1605,7 @@ var ts;
// If changing the text in this section, be sure to test `configureNightly` too.
ts.versionMajorMinor = "2.8";
/** The version of the TypeScript compiler release */
ts.version = ts.versionMajorMinor + ".2";
ts.version = ts.versionMajorMinor + ".3";
})(ts || (ts = {}));
(function (ts) {
function isExternalModuleNameRelative(moduleName) {
@@ -27283,6 +27283,10 @@ var ts;
if (initializer) {
namespace = getSymbolOfNode(initializer);
}
// Currently, IIFEs may not have a symbol and we don't know about their contents. Give up in this case.
if (!namespace) {
return undefined;
}
if (namespace.valueDeclaration &&
ts.isVariableDeclaration(namespace.valueDeclaration) &&
namespace.valueDeclaration.initializer &&
@@ -31090,7 +31094,12 @@ var ts;
return baseObjectType || baseIndexType ? getIndexedAccessType(baseObjectType || type.objectType, baseIndexType || type.indexType) : undefined;
}
function getDefaultConstraintOfConditionalType(type) {
return getUnionType([getTrueTypeFromConditionalType(type), getFalseTypeFromConditionalType(type)]);
if (!type.resolvedDefaultConstraint) {
var rootTrueType = type.root.trueType;
var rootTrueConstraint = rootTrueType.flags & 4194304 /* Substitution */ ? rootTrueType.substitute : rootTrueType;
type.resolvedDefaultConstraint = getUnionType([instantiateType(rootTrueConstraint, type.combinedMapper || type.mapper), getFalseTypeFromConditionalType(type)]);
}
return type.resolvedDefaultConstraint;
}
function getConstraintOfDistributiveConditionalType(type) {
// Check if we have a conditional type of the form 'T extends U ? X : Y', where T is a constrained
@@ -31102,7 +31111,10 @@ var ts;
var constraint = getConstraintOfType(type.checkType);
if (constraint) {
var mapper = createTypeMapper([type.root.checkType], [constraint]);
return getConditionalTypeInstantiation(type, combineTypeMappers(mapper, type.mapper));
var instantiated = getConditionalTypeInstantiation(type, combineTypeMappers(mapper, type.mapper));
if (!(instantiated.flags & 16384 /* Never */)) {
return instantiated;
}
}
}
return undefined;
@@ -32167,7 +32179,7 @@ var ts;
}
function getConstrainedTypeVariable(typeVariable, node) {
var constraints;
while (ts.isPartOfTypeNode(node)) {
while (node && !ts.isStatement(node)) {
var parent = node.parent;
if (parent.kind === 170 /* ConditionalType */ && node === parent.trueType) {
var constraint = getImpliedConstraint(typeVariable, parent.checkType, parent.extendsType);
@@ -32772,12 +32784,16 @@ var ts;
}
return links.resolvedType;
}
function getIndexTypeForGenericType(type) {
if (!type.resolvedIndexType) {
type.resolvedIndexType = createType(524288 /* Index */);
type.resolvedIndexType.type = type;
function getIndexTypeForGenericType(type, includeDeclaredTypes) {
var cacheLocation = includeDeclaredTypes ? "resolvedDeclaredIndexType" : "resolvedIndexType";
if (!type[cacheLocation]) {
type[cacheLocation] = createType(524288 /* Index */);
type[cacheLocation].type = type;
if (includeDeclaredTypes) {
type[cacheLocation].isDeclaredType = true;
}
}
return type.resolvedIndexType;
return type[cacheLocation];
}
function getLiteralTypeFromPropertyName(prop) {
var links = getSymbolLinks(getLateBoundSymbol(prop));
@@ -32793,16 +32809,20 @@ var ts;
}
return links.nameType;
}
function getLiteralTypeFromPropertyNames(type) {
return getUnionType(ts.map(getPropertiesOfType(type), getLiteralTypeFromPropertyName));
function isTypeString(type) {
return isTypeAssignableToKind(type, 524322 /* StringLike */);
}
function getIndexType(type) {
return type.flags & 262144 /* Intersection */ ? getUnionType(ts.map(type.types, function (t) { return getIndexType(t); })) :
maybeTypeOfKind(type, 7372800 /* InstantiableNonPrimitive */) ? getIndexTypeForGenericType(type) :
function getLiteralTypeFromPropertyNames(type, includeDeclaredTypes) {
var originalKeys = ts.map(getPropertiesOfType(type), getLiteralTypeFromPropertyName);
return getUnionType(includeDeclaredTypes ? originalKeys : ts.filter(originalKeys, isTypeString));
}
function getIndexType(type, includeDeclaredTypes) {
return type.flags & 262144 /* Intersection */ ? getUnionType(ts.map(type.types, function (t) { return getIndexType(t, includeDeclaredTypes); })) :
maybeTypeOfKind(type, 7372800 /* InstantiableNonPrimitive */) ? getIndexTypeForGenericType(type, includeDeclaredTypes) :
ts.getObjectFlags(type) & 32 /* Mapped */ ? getConstraintTypeFromMappedType(type) :
type === wildcardType ? wildcardType :
type.flags & 1 /* Any */ || getIndexInfoOfType(type, 0 /* String */) ? stringType :
getLiteralTypeFromPropertyNames(type);
getLiteralTypeFromPropertyNames(type, includeDeclaredTypes);
}
function getIndexTypeOrString(type) {
var indexType = getIndexType(type);
@@ -33044,16 +33064,19 @@ var ts;
// If this is a distributive conditional type and the check type is generic we need to defer
// resolution of the conditional type such that a later instantiation will properly distribute
// over union types.
if (!root.isDistributive || !maybeTypeOfKind(checkType, 7897088 /* Instantiable */)) {
var combinedMapper = void 0;
if (root.inferTypeParameters) {
var context = createInferenceContext(root.inferTypeParameters, /*signature*/ undefined, 0 /* None */);
var isDeferred = root.isDistributive && maybeTypeOfKind(checkType, 7897088 /* Instantiable */);
var combinedMapper;
if (root.inferTypeParameters) {
var context = createInferenceContext(root.inferTypeParameters, /*signature*/ undefined, 0 /* None */);
if (!isDeferred) {
// We don't want inferences from constraints as they may cause us to eagerly resolve the
// conditional type instead of deferring resolution. Also, we always want strict function
// types rules (i.e. proper contravariance) for inferences.
inferTypes(context.inferences, checkType, extendsType, 32 /* NoConstraints */ | 64 /* AlwaysStrict */);
combinedMapper = combineTypeMappers(mapper, context);
}
combinedMapper = combineTypeMappers(mapper, context);
}
if (!isDeferred) {
// Return union of trueType and falseType for 'any' since it matches anything
if (checkType.flags & 1 /* Any */) {
return getUnionType([instantiateType(root.trueType, combinedMapper || mapper), instantiateType(root.falseType, mapper)]);
@@ -33082,6 +33105,7 @@ var ts;
result.checkType = erasedCheckType;
result.extendsType = extendsType;
result.mapper = mapper;
result.combinedMapper = combinedMapper;
result.aliasSymbol = root.aliasSymbol;
result.aliasTypeArguments = instantiateTypes(root.aliasTypeArguments, mapper);
return result;
@@ -33103,13 +33127,27 @@ var ts;
}
return result;
}
function isPossiblyReferencedInConditionalType(tp, node) {
if (isTypeParameterPossiblyReferenced(tp, node)) {
return true;
}
while (node) {
if (node.kind === 170 /* ConditionalType */) {
if (isTypeParameterPossiblyReferenced(tp, node.extendsType)) {
return true;
}
}
node = node.parent;
}
return false;
}
function getTypeFromConditionalTypeNode(node) {
var links = getNodeLinks(node);
if (!links.resolvedType) {
var checkType = getTypeFromTypeNode(node.checkType);
var aliasTypeArguments = getAliasTypeArgumentsForTypeNode(node);
var allOuterTypeParameters = getOuterTypeParameters(node, /*includeThisTypes*/ true);
var outerTypeParameters = aliasTypeArguments ? allOuterTypeParameters : ts.filter(allOuterTypeParameters, function (tp) { return isTypeParameterPossiblyReferenced(tp, node); });
var outerTypeParameters = aliasTypeArguments ? allOuterTypeParameters : ts.filter(allOuterTypeParameters, function (tp) { return isPossiblyReferencedInConditionalType(tp, node); });
var root = {
node: node,
checkType: checkType,
@@ -33605,6 +33643,10 @@ var ts;
}
return type;
}
function maybeTypeParameterReference(node) {
return !(node.kind === 145 /* QualifiedName */ ||
node.parent.kind === 161 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName);
}
function isTypeParameterPossiblyReferenced(tp, node) {
// If the type parameter doesn't have exactly one declaration, if there are invening statement blocks
// between the node and the type parameter declaration, if the node contains actual references to the
@@ -33621,7 +33663,8 @@ var ts;
case 173 /* ThisType */:
return tp.isThisType;
case 71 /* Identifier */:
return !tp.isThisType && ts.isPartOfTypeNode(node) && getTypeFromTypeNode(node) === tp;
return !tp.isThisType && ts.isPartOfTypeNode(node) && maybeTypeParameterReference(node) &&
getTypeFromTypeNode(node) === tp;
case 164 /* TypeQuery */:
return true;
}
@@ -34728,7 +34771,7 @@ var ts;
// constraint of T.
var constraint = getConstraintForRelation(target.type);
if (constraint) {
if (result = isRelatedTo(source, getIndexType(constraint), reportErrors)) {
if (result = isRelatedTo(source, getIndexType(constraint, target.isDeclaredType), reportErrors)) {
return result;
}
}
@@ -44276,7 +44319,7 @@ var ts;
// Check if the index type is assignable to 'keyof T' for the object type.
var objectType = type.objectType;
var indexType = type.indexType;
if (isTypeAssignableTo(indexType, getIndexType(objectType))) {
if (isTypeAssignableTo(indexType, getIndexType(objectType, /*includeDeclaredTypes*/ true))) {
if (accessNode.kind === 184 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) &&
ts.getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) {
error(accessNode, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType));
@@ -85332,7 +85375,8 @@ var ts;
isJsxInitializer = true;
break;
case 71 /* Identifier */:
if (previousToken !== parent.name) {
// For `<div x=[|f/**/|]`, `parent` will be `x` and `previousToken.parent` will be `f` (which is its own JsxAttribute)
if (parent !== previousToken.parent && !parent.initializer) {
isJsxInitializer = previousToken;
}
}

View File

@@ -180,7 +180,7 @@ var ts;
var ts;
(function (ts) {
ts.versionMajorMinor = "2.8";
ts.version = ts.versionMajorMinor + ".2";
ts.version = ts.versionMajorMinor + ".3";
})(ts || (ts = {}));
(function (ts) {
function isExternalModuleNameRelative(moduleName) {