Make sure autoArrayType is unique, even if no lib is available (#20344)

* Make sure autoArrayType is unique, even if no lib is available

* fix typo
This commit is contained in:
Mohamed Hegazy
2017-12-01 19:51:14 -08:00
committed by GitHub
parent 1045d95a44
commit 59e5bbc393
6 changed files with 90 additions and 0 deletions

View File

@@ -25170,7 +25170,12 @@ namespace ts {
globalBooleanType = getGlobalType("Boolean" as __String, /*arity*/ 0, /*reportErrors*/ true);
globalRegExpType = getGlobalType("RegExp" as __String, /*arity*/ 0, /*reportErrors*/ true);
anyArrayType = createArrayType(anyType);
autoArrayType = createArrayType(autoType);
if (autoArrayType === emptyObjectType) {
// autoArrayType is used as a marker, so even if global Array type is not defined, it needs to be a unique type
autoArrayType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined);
}
globalReadonlyArrayType = <GenericType>getGlobalTypeOrUndefined("ReadonlyArray" as __String, /*arity*/ 1);
anyReadonlyArrayType = globalReadonlyArrayType ? createTypeFromGenericGlobalType(globalReadonlyArrayType, [anyType]) : anyArrayType;