Update LKG

This commit is contained in:
Daniel Rosenwasser
2017-06-14 17:00:51 -07:00
parent 3e72e52405
commit ed9cde9845
12 changed files with 1492 additions and 1416 deletions
+7 -7
View File
@@ -1655,7 +1655,7 @@ interface Int8Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
map(callbackfn: (this: void, value: number, index: number, array: Int8Array) => number, thisArg: any): Int8Array;
map(callbackfn: (this: void, value: number, index: number, array: Int8Array) => number, thisArg?: any): Int8Array;
/**
* Calls the specified callback function for all the elements in an array. The return value of
@@ -1922,7 +1922,7 @@ interface Uint8Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
map(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => number, thisArg: any): Uint8Array;
map(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => number, thisArg?: any): Uint8Array;
/**
* Calls the specified callback function for all the elements in an array. The return value of
@@ -2189,7 +2189,7 @@ interface Uint8ClampedArray {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
map(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => number, thisArg: any): Uint8ClampedArray;
map(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => number, thisArg?: any): Uint8ClampedArray;
/**
* Calls the specified callback function for all the elements in an array. The return value of
@@ -2454,7 +2454,7 @@ interface Int16Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
map(callbackfn: (this: void, value: number, index: number, array: Int16Array) => number, thisArg: any): Int16Array;
map(callbackfn: (this: void, value: number, index: number, array: Int16Array) => number, thisArg?: any): Int16Array;
/**
* Calls the specified callback function for all the elements in an array. The return value of
@@ -2722,7 +2722,7 @@ interface Uint16Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
map(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => number, thisArg: any): Uint16Array;
map(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => number, thisArg?: any): Uint16Array;
/**
* Calls the specified callback function for all the elements in an array. The return value of
@@ -3255,7 +3255,7 @@ interface Uint32Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
map(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => number, thisArg: any): Uint32Array;
map(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => number, thisArg?: any): Uint32Array;
/**
* Calls the specified callback function for all the elements in an array. The return value of
@@ -3522,7 +3522,7 @@ interface Float32Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
map(callbackfn: (this: void, value: number, index: number, array: Float32Array) => number, thisArg: any): Float32Array;
map(callbackfn: (this: void, value: number, index: number, array: Float32Array) => number, thisArg?: any): Float32Array;
/**
* Calls the specified callback function for all the elements in an array. The return value of
+7 -7
View File
@@ -1655,7 +1655,7 @@ interface Int8Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
map(callbackfn: (this: void, value: number, index: number, array: Int8Array) => number, thisArg: any): Int8Array;
map(callbackfn: (this: void, value: number, index: number, array: Int8Array) => number, thisArg?: any): Int8Array;
/**
* Calls the specified callback function for all the elements in an array. The return value of
@@ -1922,7 +1922,7 @@ interface Uint8Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
map(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => number, thisArg: any): Uint8Array;
map(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => number, thisArg?: any): Uint8Array;
/**
* Calls the specified callback function for all the elements in an array. The return value of
@@ -2189,7 +2189,7 @@ interface Uint8ClampedArray {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
map(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => number, thisArg: any): Uint8ClampedArray;
map(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => number, thisArg?: any): Uint8ClampedArray;
/**
* Calls the specified callback function for all the elements in an array. The return value of
@@ -2454,7 +2454,7 @@ interface Int16Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
map(callbackfn: (this: void, value: number, index: number, array: Int16Array) => number, thisArg: any): Int16Array;
map(callbackfn: (this: void, value: number, index: number, array: Int16Array) => number, thisArg?: any): Int16Array;
/**
* Calls the specified callback function for all the elements in an array. The return value of
@@ -2722,7 +2722,7 @@ interface Uint16Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
map(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => number, thisArg: any): Uint16Array;
map(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => number, thisArg?: any): Uint16Array;
/**
* Calls the specified callback function for all the elements in an array. The return value of
@@ -3255,7 +3255,7 @@ interface Uint32Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
map(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => number, thisArg: any): Uint32Array;
map(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => number, thisArg?: any): Uint32Array;
/**
* Calls the specified callback function for all the elements in an array. The return value of
@@ -3522,7 +3522,7 @@ interface Float32Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
map(callbackfn: (this: void, value: number, index: number, array: Float32Array) => number, thisArg: any): Float32Array;
map(callbackfn: (this: void, value: number, index: number, array: Float32Array) => number, thisArg?: any): Float32Array;
/**
* Calls the specified callback function for all the elements in an array. The return value of
+7 -7
View File
@@ -1655,7 +1655,7 @@ interface Int8Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
map(callbackfn: (this: void, value: number, index: number, array: Int8Array) => number, thisArg: any): Int8Array;
map(callbackfn: (this: void, value: number, index: number, array: Int8Array) => number, thisArg?: any): Int8Array;
/**
* Calls the specified callback function for all the elements in an array. The return value of
@@ -1922,7 +1922,7 @@ interface Uint8Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
map(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => number, thisArg: any): Uint8Array;
map(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => number, thisArg?: any): Uint8Array;
/**
* Calls the specified callback function for all the elements in an array. The return value of
@@ -2189,7 +2189,7 @@ interface Uint8ClampedArray {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
map(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => number, thisArg: any): Uint8ClampedArray;
map(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => number, thisArg?: any): Uint8ClampedArray;
/**
* Calls the specified callback function for all the elements in an array. The return value of
@@ -2454,7 +2454,7 @@ interface Int16Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
map(callbackfn: (this: void, value: number, index: number, array: Int16Array) => number, thisArg: any): Int16Array;
map(callbackfn: (this: void, value: number, index: number, array: Int16Array) => number, thisArg?: any): Int16Array;
/**
* Calls the specified callback function for all the elements in an array. The return value of
@@ -2722,7 +2722,7 @@ interface Uint16Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
map(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => number, thisArg: any): Uint16Array;
map(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => number, thisArg?: any): Uint16Array;
/**
* Calls the specified callback function for all the elements in an array. The return value of
@@ -3255,7 +3255,7 @@ interface Uint32Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
map(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => number, thisArg: any): Uint32Array;
map(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => number, thisArg?: any): Uint32Array;
/**
* Calls the specified callback function for all the elements in an array. The return value of
@@ -3522,7 +3522,7 @@ interface Float32Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
map(callbackfn: (this: void, value: number, index: number, array: Float32Array) => number, thisArg: any): Float32Array;
map(callbackfn: (this: void, value: number, index: number, array: Float32Array) => number, thisArg?: any): Float32Array;
/**
* Calls the specified callback function for all the elements in an array. The return value of
+107 -161
View File
@@ -142,7 +142,7 @@ var ts;
})(ts || (ts = {}));
var ts;
(function (ts) {
ts.version = "2.4.1";
ts.version = "2.4.1-insiders.20170614";
})(ts || (ts = {}));
(function (ts) {
ts.collator = typeof Intl === "object" && typeof Intl.Collator === "function" ? new Intl.Collator(undefined, { usage: "sort", sensitivity: "accent" }) : undefined;
@@ -3421,6 +3421,7 @@ var ts;
Change_spelling_to_0: { code: 90022, category: ts.DiagnosticCategory.Message, key: "Change_spelling_to_0_90022", message: "Change spelling to '{0}'." },
Declare_method_0: { code: 90023, category: ts.DiagnosticCategory.Message, key: "Declare_method_0_90023", message: "Declare method '{0}'." },
Declare_static_method_0: { code: 90024, category: ts.DiagnosticCategory.Message, key: "Declare_static_method_0_90024", message: "Declare static method '{0}'." },
Prefix_0_with_an_underscore: { code: 90025, category: ts.DiagnosticCategory.Message, key: "Prefix_0_with_an_underscore_90025", message: "Prefix '{0}' with an underscore." },
Convert_function_to_an_ES2015_class: { code: 95001, category: ts.DiagnosticCategory.Message, key: "Convert_function_to_an_ES2015_class_95001", message: "Convert function to an ES2015 class" },
Convert_function_0_to_class: { code: 95002, category: ts.DiagnosticCategory.Message, key: "Convert_function_0_to_class_95002", message: "Convert function '{0}' to class" },
Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0: { code: 8017, category: ts.DiagnosticCategory.Error, key: "Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0_8017", message: "Octal literal types must use ES2015 syntax. Use the syntax '{0}'." },
@@ -13554,7 +13555,7 @@ var ts;
processReferenceComments(sourceFile);
sourceFile.statements = parseList(0, parseStatement);
ts.Debug.assert(token() === 1);
sourceFile.endOfFileToken = parseTokenNode();
sourceFile.endOfFileToken = addJSDocComment(parseTokenNode());
setExternalModuleIndicator(sourceFile);
sourceFile.nodeCount = nodeCount;
sourceFile.identifierCount = identifierCount;
@@ -24265,9 +24266,15 @@ var ts;
writer.writeStringLiteral(literalTypeToString(type));
}
else if (type.flags & 262144) {
if (flags & 128) {
writePunctuation(writer, 19);
}
writer.writeKeyword("keyof");
writeSpace(writer);
writeType(type.type, 128);
if (flags & 128) {
writePunctuation(writer, 20);
}
}
else if (type.flags & 524288) {
writeType(type.objectType, 128);
@@ -25571,11 +25578,8 @@ var ts;
}
function getInstantiatedConstructorsForTypeArguments(type, typeArgumentNodes, location) {
var signatures = getConstructorsForTypeArguments(type, typeArgumentNodes, location);
if (typeArgumentNodes) {
var typeArguments_1 = ts.map(typeArgumentNodes, getTypeFromTypeNode);
signatures = ts.map(signatures, function (sig) { return getSignatureInstantiation(sig, typeArguments_1); });
}
return signatures;
var typeArguments = ts.map(typeArgumentNodes, getTypeFromTypeNode);
return ts.sameMap(signatures, function (sig) { return ts.some(sig.typeParameters) ? getSignatureInstantiation(sig, typeArguments) : sig; });
}
function getBaseConstructorTypeOfClass(type) {
if (!type.resolvedBaseConstructorType) {
@@ -27987,7 +27991,7 @@ var ts;
var declarations = ts.concatenate(leftProp.declarations, rightProp.declarations);
var flags = 4 | (leftProp.flags & 67108864);
var result = createSymbol(flags, leftProp.name);
result.type = getUnionType([getTypeOfSymbol(leftProp), rightType]);
result.type = getUnionType([getTypeOfSymbol(leftProp), getTypeWithFacts(rightType, 131072)]);
result.leftSpread = leftProp;
result.rightSpread = rightProp;
result.declarations = declarations;
@@ -28541,9 +28545,6 @@ var ts;
function areTypesComparable(type1, type2) {
return isTypeComparableTo(type1, type2) || isTypeComparableTo(type2, type1);
}
function checkTypeSubtypeOf(source, target, errorNode, headMessage, containingMessageChain) {
return checkTypeRelatedTo(source, target, subtypeRelation, errorNode, headMessage, containingMessageChain);
}
function checkTypeAssignableTo(source, target, errorNode, headMessage, containingMessageChain) {
return checkTypeRelatedTo(source, target, assignableRelation, errorNode, headMessage, containingMessageChain);
}
@@ -28965,8 +28966,7 @@ var ts;
(isTypeSubsetOf(globalObjectType, target) || (!isComparingJsxAttributes && isEmptyObjectType(target)))) {
return false;
}
for (var _i = 0, _a = getPropertiesOfObjectType(source); _i < _a.length; _i++) {
var prop = _a[_i];
var _loop_4 = function (prop) {
if (!isKnownProperty(target, prop.name, isComparingJsxAttributes)) {
if (reportErrors) {
ts.Debug.assert(!!errorNode);
@@ -28974,14 +28974,21 @@ var ts;
reportError(ts.Diagnostics.Property_0_does_not_exist_on_type_1, symbolToString(prop), typeToString(target));
}
else {
if (prop.valueDeclaration) {
var objectLiteralDeclaration_1 = source.symbol && ts.firstOrUndefined(source.symbol.declarations);
if (prop.valueDeclaration && ts.findAncestor(prop.valueDeclaration, function (d) { return d === objectLiteralDeclaration_1; })) {
errorNode = prop.valueDeclaration;
}
reportError(ts.Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString(prop), typeToString(target));
}
}
return true;
return { value: true };
}
};
for (var _i = 0, _a = getPropertiesOfObjectType(source); _i < _a.length; _i++) {
var prop = _a[_i];
var state_2 = _loop_4(prop);
if (typeof state_2 === "object")
return state_2.value;
}
}
return false;
@@ -29717,18 +29724,10 @@ var ts;
function isRestParameterIndex(signature, parameterIndex) {
return signature.hasRestParameter && parameterIndex >= signature.parameters.length - 1;
}
function isSupertypeOfEach(candidate, types) {
for (var _i = 0, types_9 = types; _i < types_9.length; _i++) {
var t = types_9[_i];
if (candidate !== t && !isTypeSubtypeOf(t, candidate))
return false;
}
return true;
}
function literalTypesWithSameBaseType(types) {
var commonBaseType;
for (var _i = 0, types_10 = types; _i < types_10.length; _i++) {
var t = types_10[_i];
for (var _i = 0, types_9 = types; _i < types_9.length; _i++) {
var t = types_9[_i];
var baseType = getBaseTypeOfLiteralType(t);
if (!commonBaseType) {
commonBaseType = baseType;
@@ -29740,45 +29739,18 @@ var ts;
return true;
}
function getSupertypeOrUnion(types) {
return literalTypesWithSameBaseType(types) ? getUnionType(types) : ts.forEach(types, function (t) { return isSupertypeOfEach(t, types) ? t : undefined; });
return literalTypesWithSameBaseType(types) ?
getUnionType(types) :
ts.reduceLeft(types, function (s, t) { return isTypeSubtypeOf(s, t) ? t : s; });
}
function getCommonSupertype(types) {
if (!strictNullChecks) {
return getSupertypeOrUnion(types);
}
var primaryTypes = ts.filter(types, function (t) { return !(t.flags & 6144); });
if (!primaryTypes.length) {
return getUnionType(types, true);
}
var supertype = getSupertypeOrUnion(primaryTypes);
return supertype && getNullableType(supertype, getFalsyFlagsOfTypes(types) & 6144);
}
function reportNoCommonSupertypeError(types, errorLocation, errorMessageChainHead) {
var bestSupertype;
var bestSupertypeDownfallType;
var bestSupertypeScore = 0;
for (var i = 0; i < types.length; i++) {
var score = 0;
var downfallType = undefined;
for (var j = 0; j < types.length; j++) {
if (isTypeSubtypeOf(types[j], types[i])) {
score++;
}
else if (!downfallType) {
downfallType = types[j];
}
}
ts.Debug.assert(!!downfallType, "If there is no common supertype, each type should have a downfallType");
if (score > bestSupertypeScore) {
bestSupertype = types[i];
bestSupertypeDownfallType = downfallType;
bestSupertypeScore = score;
}
if (bestSupertypeScore === types.length - 1) {
break;
}
}
checkTypeSubtypeOf(bestSupertypeDownfallType, bestSupertype, errorLocation, ts.Diagnostics.Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0, errorMessageChainHead);
return primaryTypes.length ?
getNullableType(getSupertypeOrUnion(primaryTypes), getFalsyFlagsOfTypes(types) & 6144) :
getUnionType(types, true);
}
function isArrayType(type) {
return getObjectFlags(type) & 4 && type.target === globalArrayType;
@@ -29819,8 +29791,8 @@ var ts;
}
function getFalsyFlagsOfTypes(types) {
var result = 0;
for (var _i = 0, types_11 = types; _i < types_11.length; _i++) {
var t = types_11[_i];
for (var _i = 0, types_10 = types; _i < types_10.length; _i++) {
var t = types_10[_i];
result |= getFalsyFlags(t);
}
return result;
@@ -30341,8 +30313,8 @@ var ts;
}
}
function typeIdenticalToSomeType(type, types) {
for (var _i = 0, types_12 = types; _i < types_12.length; _i++) {
var t = types_12[_i];
for (var _i = 0, types_11 = types; _i < types_11.length; _i++) {
var t = types_11[_i];
if (isTypeIdenticalTo(t, type)) {
return true;
}
@@ -30366,7 +30338,6 @@ var ts;
function getInferredType(context, index) {
var inference = context.inferences[index];
var inferredType = inference.inferredType;
var inferenceSucceeded;
if (!inferredType) {
if (inference.candidates) {
var signature = context.signature;
@@ -30376,37 +30347,28 @@ var ts;
var baseCandidates = widenLiteralTypes ? ts.sameMap(inference.candidates, getWidenedLiteralType) : inference.candidates;
var unionOrSuperType = context.flags & 1 || inference.priority & 4 ?
getUnionType(baseCandidates, true) : getCommonSupertype(baseCandidates);
inferredType = unionOrSuperType ? getWidenedType(unionOrSuperType) : unknownType;
inferenceSucceeded = !!unionOrSuperType;
inferredType = getWidenedType(unionOrSuperType);
}
else if (context.flags & 2) {
inferredType = silentNeverType;
}
else {
if (context.flags & 2) {
inferredType = silentNeverType;
var defaultType = getDefaultFromTypeParameter(inference.typeParameter);
if (defaultType) {
inferredType = instantiateType(defaultType, combineTypeMappers(createBackreferenceMapper(context.signature.typeParameters, index), context));
}
else {
var defaultType = getDefaultFromTypeParameter(inference.typeParameter);
if (defaultType) {
inferredType = instantiateType(defaultType, combineTypeMappers(createBackreferenceMapper(context.signature.typeParameters, index), context));
}
else {
inferredType = context.flags & 4 ? anyType : emptyObjectType;
}
inferredType = context.flags & 4 ? anyType : emptyObjectType;
}
inferenceSucceeded = true;
}
inference.inferredType = inferredType;
if (inferenceSucceeded) {
var constraint = getConstraintOfTypeParameter(context.signature.typeParameters[index]);
if (constraint) {
var instantiatedConstraint = instantiateType(constraint, context);
if (!isTypeAssignableTo(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) {
inference.inferredType = inferredType = instantiatedConstraint;
}
var constraint = getConstraintOfTypeParameter(context.signature.typeParameters[index]);
if (constraint) {
var instantiatedConstraint = instantiateType(constraint, context);
if (!isTypeAssignableTo(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) {
inference.inferredType = inferredType = instantiatedConstraint;
}
}
else if (context.failedTypeParameterIndex === undefined || context.failedTypeParameterIndex > index) {
context.failedTypeParameterIndex = index;
}
}
return inferredType;
}
@@ -30555,8 +30517,8 @@ var ts;
}
function getTypeFactsOfTypes(types) {
var result = 0;
for (var _i = 0, types_13 = types; _i < types_13.length; _i++) {
var t = types_13[_i];
for (var _i = 0, types_12 = types; _i < types_12.length; _i++) {
var t = types_12[_i];
result |= getTypeFacts(t);
}
return result;
@@ -30806,8 +30768,8 @@ var ts;
var types = type.types;
var mappedType;
var mappedTypes;
for (var _i = 0, types_14 = types; _i < types_14.length; _i++) {
var current = types_14[_i];
for (var _i = 0, types_13 = types; _i < types_13.length; _i++) {
var current = types_13[_i];
var t = mapper(current);
if (t) {
if (!mappedType) {
@@ -30876,8 +30838,8 @@ var ts;
}
function isEvolvingArrayTypeList(types) {
var hasEvolvingArrayType = false;
for (var _i = 0, types_15 = types; _i < types_15.length; _i++) {
var t = types_15[_i];
for (var _i = 0, types_14 = types; _i < types_14.length; _i++) {
var t = types_14[_i];
if (!(t.flags & 8192)) {
if (!(getObjectFlags(t) & 256)) {
return false;
@@ -32291,8 +32253,8 @@ var ts;
}
var signatureList;
var types = type.types;
for (var _i = 0, types_16 = types; _i < types_16.length; _i++) {
var current = types_16[_i];
for (var _i = 0, types_15 = types; _i < types_15.length; _i++) {
var current = types_15[_i];
var signature = getContextualCallSignature(current, node);
if (signature) {
if (!signatureList) {
@@ -33347,12 +33309,23 @@ var ts;
var left = node.kind === 179
? node.expression
: node.left;
var type = checkExpression(left);
return isValidPropertyAccessWithType(node, left, propertyName, getWidenedType(checkExpression(left)));
}
function isValidPropertyAccessWithType(node, left, propertyName, type) {
if (type !== unknownType && !isTypeAny(type)) {
var prop = getPropertyOfType(getWidenedType(type), propertyName);
var prop = getPropertyOfType(type, propertyName);
if (prop) {
return checkPropertyAccessibility(node, left, type, prop);
}
if (ts.isInJavaScriptFile(left) && (type.flags & 65536)) {
for (var _i = 0, _a = type.types; _i < _a.length; _i++) {
var elementType = _a[_i];
if (isValidPropertyAccessWithType(node, left, propertyName, elementType)) {
return true;
}
}
}
return false;
}
return true;
}
@@ -33602,9 +33575,6 @@ var ts;
inferences[i].inferredType = undefined;
}
}
if (context.failedTypeParameterIndex !== undefined && !context.inferences[context.failedTypeParameterIndex].isFixed) {
context.failedTypeParameterIndex = undefined;
}
if (ts.isExpression(node)) {
var contextualType = getContextualType(node);
if (contextualType) {
@@ -33926,16 +33896,12 @@ var ts;
}
var candidateForArgumentError;
var candidateForTypeArgumentError;
var resultOfFailedInference;
var result;
var signatureHelpTrailingComma = candidatesOutArray && node.kind === 181 && node.arguments.hasTrailingComma;
if (candidates.length > 1) {
result = chooseOverload(candidates, subtypeRelation, signatureHelpTrailingComma);
}
if (!result) {
candidateForArgumentError = undefined;
candidateForTypeArgumentError = undefined;
resultOfFailedInference = undefined;
result = chooseOverload(candidates, assignableRelation, signatureHelpTrailingComma);
}
if (result) {
@@ -33948,20 +33914,8 @@ var ts;
checkApplicableSignature(node, args, candidateForArgumentError, assignableRelation, undefined, true);
}
else if (candidateForTypeArgumentError) {
if (!isTaggedTemplate && !isDecorator && typeArguments) {
var typeArguments_2 = node.typeArguments;
checkTypeArguments(candidateForTypeArgumentError, typeArguments_2, ts.map(typeArguments_2, getTypeFromTypeNode), true, fallbackError);
}
else {
ts.Debug.assert(resultOfFailedInference.failedTypeParameterIndex >= 0);
var failedTypeParameter = candidateForTypeArgumentError.typeParameters[resultOfFailedInference.failedTypeParameterIndex];
var inferenceCandidates = resultOfFailedInference.inferences[resultOfFailedInference.failedTypeParameterIndex].candidates;
var diagnosticChainHead = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly, typeToString(failedTypeParameter));
if (fallbackError) {
diagnosticChainHead = ts.chainDiagnosticMessages(diagnosticChainHead, fallbackError);
}
reportNoCommonSupertypeError(inferenceCandidates, node.tagName || node.expression || node.tag, diagnosticChainHead);
}
var typeArguments_1 = node.typeArguments;
checkTypeArguments(candidateForTypeArgumentError, typeArguments_1, ts.map(typeArguments_1, getTypeFromTypeNode), true, fallbackError);
}
else if (typeArguments && ts.every(signatures, function (sig) { return ts.length(sig.typeParameters) !== typeArguments.length; })) {
var min = Number.POSITIVE_INFINITY;
@@ -34011,34 +33965,35 @@ var ts;
return resolveErrorCall(node);
function chooseOverload(candidates, relation, signatureHelpTrailingComma) {
if (signatureHelpTrailingComma === void 0) { signatureHelpTrailingComma = false; }
candidateForArgumentError = undefined;
candidateForTypeArgumentError = undefined;
for (var _i = 0, candidates_2 = candidates; _i < candidates_2.length; _i++) {
var originalCandidate = candidates_2[_i];
if (!hasCorrectArity(node, args, originalCandidate, signatureHelpTrailingComma)) {
continue;
}
var candidate = void 0;
var typeArgumentsAreValid = void 0;
var inferenceContext = originalCandidate.typeParameters
? createInferenceContext(originalCandidate, ts.isInJavaScriptFile(node) ? 4 : 0)
: undefined;
var inferenceContext = originalCandidate.typeParameters ?
createInferenceContext(originalCandidate, ts.isInJavaScriptFile(node) ? 4 : 0) :
undefined;
while (true) {
candidate = originalCandidate;
if (candidate.typeParameters) {
var typeArgumentTypes = void 0;
if (typeArguments) {
typeArgumentTypes = fillMissingTypeArguments(ts.map(typeArguments, getTypeFromTypeNode), candidate.typeParameters, getMinTypeArgumentCount(candidate.typeParameters));
typeArgumentsAreValid = checkTypeArguments(candidate, typeArguments, typeArgumentTypes, false);
if (!checkTypeArguments(candidate, typeArguments, typeArgumentTypes, false)) {
candidateForTypeArgumentError = originalCandidate;
break;
}
}
else {
typeArgumentTypes = inferTypeArguments(node, candidate, args, excludeArgument, inferenceContext);
typeArgumentsAreValid = inferenceContext.failedTypeParameterIndex === undefined;
}
if (!typeArgumentsAreValid) {
break;
}
candidate = getSignatureInstantiation(candidate, typeArgumentTypes);
}
if (!checkApplicableSignature(node, args, candidate, relation, excludeArgument, false)) {
candidateForArgumentError = candidate;
break;
}
var index = excludeArgument ? ts.indexOf(excludeArgument, true) : -1;
@@ -34047,22 +34002,6 @@ var ts;
}
excludeArgument[index] = false;
}
if (originalCandidate.typeParameters) {
var instantiatedCandidate = candidate;
if (typeArgumentsAreValid) {
candidateForArgumentError = instantiatedCandidate;
}
else {
candidateForTypeArgumentError = originalCandidate;
if (!typeArguments) {
resultOfFailedInference = inferenceContext;
}
}
}
else {
ts.Debug.assert(originalCandidate === candidate);
candidateForArgumentError = originalCandidate;
}
}
return undefined;
}
@@ -34265,8 +34204,8 @@ var ts;
if (elementType.flags & 65536) {
var types = elementType.types;
var result = void 0;
for (var _i = 0, types_17 = types; _i < types_17.length; _i++) {
var type = types_17[_i];
for (var _i = 0, types_16 = types; _i < types_16.length; _i++) {
var type = types_16[_i];
result = result || resolveStatelessJsxOpeningLikeElement(openingLikeElement, type, candidatesOutArray);
}
return result;
@@ -34932,8 +34871,8 @@ var ts;
}
if (type.flags & 196608) {
var types = type.types;
for (var _i = 0, types_18 = types; _i < types_18.length; _i++) {
var t = types_18[_i];
for (var _i = 0, types_17 = types; _i < types_17.length; _i++) {
var t = types_17[_i];
if (maybeTypeOfKind(t, kind)) {
return true;
}
@@ -34947,8 +34886,8 @@ var ts;
}
if (type.flags & 65536) {
var types = type.types;
for (var _i = 0, types_19 = types; _i < types_19.length; _i++) {
var t = types_19[_i];
for (var _i = 0, types_18 = types; _i < types_18.length; _i++) {
var t = types_18[_i];
if (!isTypeOfKind(t, kind)) {
return false;
}
@@ -34957,8 +34896,8 @@ var ts;
}
if (type.flags & 131072) {
var types = type.types;
for (var _a = 0, types_20 = types; _a < types_20.length; _a++) {
var t = types_20[_a];
for (var _a = 0, types_19 = types; _a < types_19.length; _a++) {
var t = types_19[_a];
if (isTypeOfKind(t, kind)) {
return true;
}
@@ -37924,7 +37863,7 @@ var ts;
var staticBaseType = getApparentType(baseConstructorType);
checkBaseTypeAccessibility(staticBaseType, baseTypeNode);
checkSourceElement(baseTypeNode.expression);
if (baseTypeNode.typeArguments) {
if (ts.some(baseTypeNode.typeArguments)) {
ts.forEach(baseTypeNode.typeArguments, checkSourceElement);
for (var _i = 0, _a = getConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments, baseTypeNode); _i < _a.length; _i++) {
var constructor = _a[_i];
@@ -39212,13 +39151,9 @@ var ts;
}
return undefined;
case 9:
if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) &&
ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) ||
((node.parent.kind === 238 || node.parent.kind === 244) &&
node.parent.moduleSpecifier === node)) {
return resolveExternalModuleName(node, node);
}
if (ts.isInJavaScriptFile(node) && ts.isRequireCall(node.parent, false)) {
if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) ||
((node.parent.kind === 238 || node.parent.kind === 244) && node.parent.moduleSpecifier === node) ||
((ts.isInJavaScriptFile(node) && ts.isRequireCall(node.parent, false)) || ts.isImportCall(node.parent))) {
return resolveExternalModuleName(node, node);
}
case 8:
@@ -39552,6 +39487,12 @@ var ts;
parameter.initializer &&
!(ts.getModifierFlags(parameter) & 92);
}
function isOptionalUninitializedParameterProperty(parameter) {
return strictNullChecks &&
isOptionalParameter(parameter) &&
!parameter.initializer &&
!!(ts.getModifierFlags(parameter) & 92);
}
function getNodeCheckFlags(node) {
return getNodeLinks(node).flags;
}
@@ -39727,6 +39668,7 @@ var ts;
isDeclarationVisible: isDeclarationVisible,
isImplementationOfOverload: isImplementationOfOverload,
isRequiredInitializedParameter: isRequiredInitializedParameter,
isOptionalUninitializedParameterProperty: isOptionalUninitializedParameterProperty,
writeTypeOfDeclaration: writeTypeOfDeclaration,
writeReturnTypeOfSignatureDeclaration: writeReturnTypeOfSignatureDeclaration,
writeTypeOfExpression: writeTypeOfExpression,
@@ -40332,6 +40274,10 @@ var ts;
var sourceFile = ts.getSourceFileOfNode(node);
return grammarErrorAtPos(sourceFile, types.pos, 0, ts.Diagnostics._0_list_cannot_be_empty, listType);
}
return ts.forEach(types, checkGrammarExpressionWithTypeArguments);
}
function checkGrammarExpressionWithTypeArguments(node) {
return checkGrammarTypeArguments(node, node.typeArguments);
}
function checkGrammarClassDeclarationHeritageClauses(node) {
var seenExtendsClause = false;
@@ -46643,10 +46589,9 @@ var ts;
statements.push(extendsCall);
classBodyStart++;
}
statements.push(ts.updateVariableStatement(varStatement, undefined, ts.updateVariableDeclarationList(varStatement.declarationList, [
ts.updateVariableDeclaration(variable, variable.name, undefined, ts.updateBinary(aliasAssignment, aliasAssignment.left, ts.convertFunctionDeclarationToExpression(ts.cast(funcStatements[classBodyStart], ts.isFunctionDeclaration))))
])));
statements.push(funcStatements[classBodyStart]);
classBodyStart++;
statements.push(ts.createStatement(ts.createAssignment(aliasAssignment.left, ts.cast(variable.name, ts.isIdentifier))));
}
while (!ts.isReturnStatement(ts.elementAt(funcStatements, classBodyEnd))) {
classBodyEnd--;
@@ -51401,7 +51346,8 @@ var ts;
writer.getSymbolAccessibilityDiagnostic = getSymbolAccessibilityDiagnostic;
write(": ");
var shouldUseResolverType = declaration.kind === 146 &&
resolver.isRequiredInitializedParameter(declaration);
(resolver.isRequiredInitializedParameter(declaration) ||
resolver.isOptionalUninitializedParameterProperty(declaration));
if (type && !shouldUseResolverType) {
emitType(type);
}
+347 -292
View File
File diff suppressed because it is too large Load Diff
+7 -4
View File
@@ -2339,7 +2339,7 @@ declare namespace ts {
}
}
declare namespace ts {
const version = "2.4.1";
const version = "2.4.1-insiders.20170614";
}
declare function setTimeout(handler: (...args: any[]) => void, timeout: number): any;
declare function clearTimeout(handle: any): void;
@@ -5038,17 +5038,18 @@ declare namespace ts.server {
declare namespace ts.server {
class LSHost implements ts.LanguageServiceHost, ModuleResolutionHost {
private readonly host;
private readonly project;
private project;
private readonly cancellationToken;
private compilationSettings;
private readonly resolvedModuleNames;
private readonly resolvedTypeReferenceDirectives;
private readonly getCanonicalFileName;
private filesWithChangedSetOfUnresolvedImports;
private readonly resolveModuleName;
private resolveModuleName;
readonly trace: (s: string) => void;
readonly realpath?: (path: string) => string;
constructor(host: ServerHost, project: Project, cancellationToken: HostCancellationToken);
dispose(): void;
startRecordingFilesWithChangedResolutions(): void;
finishRecordingFilesWithChangedResolutions(): Path[];
private resolveNamesWithLocalCache<T, R>(names, containingFile, cache, loader, getResult, getResultFileName, logChanges);
@@ -5164,7 +5165,7 @@ declare namespace ts.server {
private lastCachedUnresolvedImportsList;
protected languageService: LanguageService;
languageServiceEnabled: boolean;
protected readonly lsHost: LSHost;
protected lsHost: LSHost;
builder: Builder;
private updatedFileNames;
private lastReportedFileNames;
@@ -5428,6 +5429,7 @@ declare namespace ts.server {
private removeProject(project);
private assignScriptInfoToInferredProjectIfNecessary(info, addToListOfOpenFiles);
private closeOpenFile(info);
private deleteOrphanScriptInfoNotInAnyProject();
private openOrUpdateConfiguredProjectForFile(fileName, projectRootPath?);
private findConfigFile(searchPath, projectRootPath?);
private printProjects();
@@ -5447,6 +5449,7 @@ declare namespace ts.server {
createInferredProjectWithRootFileIfNecessary(root: ScriptInfo): InferredProject;
getOrCreateScriptInfo(uncheckedFileName: string, openedByClient: boolean, fileContent?: string, scriptKind?: ScriptKind): ScriptInfo;
getScriptInfo(uncheckedFileName: string): ScriptInfo;
watchClosedScriptInfo(info: ScriptInfo): void;
getOrCreateScriptInfoForNormalizedPath(fileName: NormalizedPath, openedByClient: boolean, fileContent?: string, scriptKind?: ScriptKind, hasMixedContent?: boolean): ScriptInfo;
getScriptInfoForNormalizedPath(fileName: NormalizedPath): ScriptInfo;
getScriptInfoForPath(fileName: Path): ScriptInfo;
+344 -289
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -2593,7 +2593,7 @@ declare namespace ts {
}
declare namespace ts {
/** The version of the TypeScript compiler release */
const version = "2.4.1";
const version = "2.4.1-insiders.20170614";
}
declare function setTimeout(handler: (...args: any[]) => void, timeout: number): any;
declare function clearTimeout(handle: any): void;
+331 -323
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -2593,7 +2593,7 @@ declare namespace ts {
}
declare namespace ts {
/** The version of the TypeScript compiler release */
const version = "2.4.1";
const version = "2.4.1-insiders.20170614";
}
declare function setTimeout(handler: (...args: any[]) => void, timeout: number): any;
declare function clearTimeout(handle: any): void;
+331 -323
View File
File diff suppressed because it is too large Load Diff
+2 -1
View File
@@ -152,7 +152,7 @@ var ts;
})(ts || (ts = {}));
var ts;
(function (ts) {
ts.version = "2.4.1";
ts.version = "2.4.1-insiders.20170614";
})(ts || (ts = {}));
(function (ts) {
ts.collator = typeof Intl === "object" && typeof Intl.Collator === "function" ? new Intl.Collator(undefined, { usage: "sort", sensitivity: "accent" }) : undefined;
@@ -3431,6 +3431,7 @@ var ts;
Change_spelling_to_0: { code: 90022, category: ts.DiagnosticCategory.Message, key: "Change_spelling_to_0_90022", message: "Change spelling to '{0}'." },
Declare_method_0: { code: 90023, category: ts.DiagnosticCategory.Message, key: "Declare_method_0_90023", message: "Declare method '{0}'." },
Declare_static_method_0: { code: 90024, category: ts.DiagnosticCategory.Message, key: "Declare_static_method_0_90024", message: "Declare static method '{0}'." },
Prefix_0_with_an_underscore: { code: 90025, category: ts.DiagnosticCategory.Message, key: "Prefix_0_with_an_underscore_90025", message: "Prefix '{0}' with an underscore." },
Convert_function_to_an_ES2015_class: { code: 95001, category: ts.DiagnosticCategory.Message, key: "Convert_function_to_an_ES2015_class_95001", message: "Convert function to an ES2015 class" },
Convert_function_0_to_class: { code: 95002, category: ts.DiagnosticCategory.Message, key: "Convert_function_0_to_class_95002", message: "Convert function '{0}' to class" },
Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0: { code: 8017, category: ts.DiagnosticCategory.Error, key: "Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0_8017", message: "Octal literal types must use ES2015 syntax. Use the syntax '{0}'." },