Fixes fallback checks that cause an exception during call resolution for an async function

This commit is contained in:
Ron Buckton 2015-08-28 15:13:32 -07:00
parent 90aff0c654
commit 1ea378859c

View file

@ -4036,7 +4036,7 @@ namespace ts {
*/
function createTypedPropertyDescriptorType(propertyType: Type): Type {
let globalTypedPropertyDescriptorType = getGlobalTypedPropertyDescriptorType();
return globalTypedPropertyDescriptorType !== emptyObjectType
return globalTypedPropertyDescriptorType !== emptyGenericType
? createTypeReference(<GenericType>globalTypedPropertyDescriptorType, [propertyType])
: emptyObjectType;
}
@ -9176,7 +9176,7 @@ namespace ts {
function createPromiseType(promisedType: Type): Type {
// creates a `Promise<T>` type where `T` is the promisedType argument
let globalPromiseType = getGlobalPromiseType();
if (globalPromiseType !== emptyObjectType) {
if (globalPromiseType !== emptyGenericType) {
// if the promised type is itself a promise, get the underlying type; otherwise, fallback to the promised type
promisedType = getAwaitedType(promisedType);
return createTypeReference(<GenericType>globalPromiseType, [promisedType]);
@ -14633,7 +14633,7 @@ namespace ts {
function createInstantiatedPromiseLikeType(): ObjectType {
let promiseLikeType = getGlobalPromiseLikeType();
if (promiseLikeType !== emptyObjectType) {
if (promiseLikeType !== emptyGenericType) {
return createTypeReference(<GenericType>promiseLikeType, [anyType]);
}