Update LKG

This commit is contained in:
Mohamed Hegazy 2016-09-12 12:38:32 -07:00
parent 9986f81981
commit b8759b38ee
6 changed files with 48 additions and 33 deletions

View File

@ -4271,10 +4271,13 @@ var ts;
(node.name.kind === 9 || isGlobalScopeAugmentation(node));
}
ts.isAmbientModule = isAmbientModule;
function isShorthandAmbientModuleSymbol(moduleSymbol) {
return isShorthandAmbientModule(moduleSymbol.valueDeclaration);
}
ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol;
function isShorthandAmbientModule(node) {
return node.kind === 225 && (!node.body);
}
ts.isShorthandAmbientModule = isShorthandAmbientModule;
function isBlockScopedContainerTopLevel(node) {
return node.kind === 256 ||
node.kind === 225 ||
@ -13944,7 +13947,7 @@ var ts;
function getTargetOfImportClause(node) {
var moduleSymbol = resolveExternalModuleName(node, node.parent.moduleSpecifier);
if (moduleSymbol) {
var exportDefaultSymbol = ts.isShorthandAmbientModule(moduleSymbol.valueDeclaration) ?
var exportDefaultSymbol = ts.isShorthandAmbientModuleSymbol(moduleSymbol) ?
moduleSymbol :
moduleSymbol.exports["export="] ?
getPropertyOfType(getTypeOfSymbol(moduleSymbol.exports["export="]), "default") :
@ -13999,7 +14002,7 @@ var ts;
if (targetSymbol) {
var name_10 = specifier.propertyName || specifier.name;
if (name_10.text) {
if (ts.isShorthandAmbientModule(moduleSymbol.valueDeclaration)) {
if (ts.isShorthandAmbientModuleSymbol(moduleSymbol)) {
return moduleSymbol;
}
var symbolFromVariable = void 0;
@ -15774,7 +15777,7 @@ var ts;
function getTypeOfFuncClassEnumModule(symbol) {
var links = getSymbolLinks(symbol);
if (!links.type) {
if (symbol.valueDeclaration.kind === 225 && ts.isShorthandAmbientModule(symbol.valueDeclaration)) {
if (symbol.valueDeclaration.kind === 225 && ts.isShorthandAmbientModuleSymbol(symbol)) {
links.type = anyType;
}
else {
@ -20167,7 +20170,7 @@ var ts;
}
}
var targetType = type.flags & 16384 ? getApparentType(type) : type;
return isTypeSubtypeOf(candidate, targetType) ? candidate :
return isTypeSubtypeOf(candidate, type) ? candidate :
isTypeAssignableTo(type, candidate) ? type :
isTypeAssignableTo(candidate, targetType) ? candidate :
getIntersectionType([type, candidate]);
@ -27123,7 +27126,7 @@ var ts;
}
function moduleExportsSomeValue(moduleReferenceExpression) {
var moduleSymbol = resolveExternalModuleName(moduleReferenceExpression.parent, moduleReferenceExpression);
if (!moduleSymbol) {
if (!moduleSymbol || ts.isShorthandAmbientModuleSymbol(moduleSymbol)) {
return true;
}
var hasExportAssignment = hasExportAssignmentSymbol(moduleSymbol);

View File

@ -5267,10 +5267,13 @@ var ts;
(node.name.kind === 9 || isGlobalScopeAugmentation(node));
}
ts.isAmbientModule = isAmbientModule;
function isShorthandAmbientModuleSymbol(moduleSymbol) {
return isShorthandAmbientModule(moduleSymbol.valueDeclaration);
}
ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol;
function isShorthandAmbientModule(node) {
return node.kind === 225 && (!node.body);
}
ts.isShorthandAmbientModule = isShorthandAmbientModule;
function isBlockScopedContainerTopLevel(node) {
return node.kind === 256 ||
node.kind === 225 ||
@ -14940,7 +14943,7 @@ var ts;
function getTargetOfImportClause(node) {
var moduleSymbol = resolveExternalModuleName(node, node.parent.moduleSpecifier);
if (moduleSymbol) {
var exportDefaultSymbol = ts.isShorthandAmbientModule(moduleSymbol.valueDeclaration) ?
var exportDefaultSymbol = ts.isShorthandAmbientModuleSymbol(moduleSymbol) ?
moduleSymbol :
moduleSymbol.exports["export="] ?
getPropertyOfType(getTypeOfSymbol(moduleSymbol.exports["export="]), "default") :
@ -14995,7 +14998,7 @@ var ts;
if (targetSymbol) {
var name_12 = specifier.propertyName || specifier.name;
if (name_12.text) {
if (ts.isShorthandAmbientModule(moduleSymbol.valueDeclaration)) {
if (ts.isShorthandAmbientModuleSymbol(moduleSymbol)) {
return moduleSymbol;
}
var symbolFromVariable = void 0;
@ -16770,7 +16773,7 @@ var ts;
function getTypeOfFuncClassEnumModule(symbol) {
var links = getSymbolLinks(symbol);
if (!links.type) {
if (symbol.valueDeclaration.kind === 225 && ts.isShorthandAmbientModule(symbol.valueDeclaration)) {
if (symbol.valueDeclaration.kind === 225 && ts.isShorthandAmbientModuleSymbol(symbol)) {
links.type = anyType;
}
else {
@ -21163,7 +21166,7 @@ var ts;
}
}
var targetType = type.flags & 16384 ? getApparentType(type) : type;
return isTypeSubtypeOf(candidate, targetType) ? candidate :
return isTypeSubtypeOf(candidate, type) ? candidate :
isTypeAssignableTo(type, candidate) ? type :
isTypeAssignableTo(candidate, targetType) ? candidate :
getIntersectionType([type, candidate]);
@ -28119,7 +28122,7 @@ var ts;
}
function moduleExportsSomeValue(moduleReferenceExpression) {
var moduleSymbol = resolveExternalModuleName(moduleReferenceExpression.parent, moduleReferenceExpression);
if (!moduleSymbol) {
if (!moduleSymbol || ts.isShorthandAmbientModuleSymbol(moduleSymbol)) {
return true;
}
var hasExportAssignment = hasExportAssignmentSymbol(moduleSymbol);

View File

@ -7043,7 +7043,7 @@ declare namespace ts {
function makeIdentifierFromModuleName(moduleName: string): string;
function isBlockOrCatchScoped(declaration: Declaration): boolean;
function isAmbientModule(node: Node): boolean;
function isShorthandAmbientModule(node: Node): boolean;
function isShorthandAmbientModuleSymbol(moduleSymbol: Symbol): boolean;
function isBlockScopedContainerTopLevel(node: Node): boolean;
function isGlobalScopeAugmentation(module: ModuleDeclaration): boolean;
function isExternalModuleAugmentation(node: Node): boolean;

View File

@ -5267,10 +5267,13 @@ var ts;
(node.name.kind === 9 || isGlobalScopeAugmentation(node));
}
ts.isAmbientModule = isAmbientModule;
function isShorthandAmbientModuleSymbol(moduleSymbol) {
return isShorthandAmbientModule(moduleSymbol.valueDeclaration);
}
ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol;
function isShorthandAmbientModule(node) {
return node.kind === 225 && (!node.body);
}
ts.isShorthandAmbientModule = isShorthandAmbientModule;
function isBlockScopedContainerTopLevel(node) {
return node.kind === 256 ||
node.kind === 225 ||
@ -14940,7 +14943,7 @@ var ts;
function getTargetOfImportClause(node) {
var moduleSymbol = resolveExternalModuleName(node, node.parent.moduleSpecifier);
if (moduleSymbol) {
var exportDefaultSymbol = ts.isShorthandAmbientModule(moduleSymbol.valueDeclaration) ?
var exportDefaultSymbol = ts.isShorthandAmbientModuleSymbol(moduleSymbol) ?
moduleSymbol :
moduleSymbol.exports["export="] ?
getPropertyOfType(getTypeOfSymbol(moduleSymbol.exports["export="]), "default") :
@ -14995,7 +14998,7 @@ var ts;
if (targetSymbol) {
var name_12 = specifier.propertyName || specifier.name;
if (name_12.text) {
if (ts.isShorthandAmbientModule(moduleSymbol.valueDeclaration)) {
if (ts.isShorthandAmbientModuleSymbol(moduleSymbol)) {
return moduleSymbol;
}
var symbolFromVariable = void 0;
@ -16770,7 +16773,7 @@ var ts;
function getTypeOfFuncClassEnumModule(symbol) {
var links = getSymbolLinks(symbol);
if (!links.type) {
if (symbol.valueDeclaration.kind === 225 && ts.isShorthandAmbientModule(symbol.valueDeclaration)) {
if (symbol.valueDeclaration.kind === 225 && ts.isShorthandAmbientModuleSymbol(symbol)) {
links.type = anyType;
}
else {
@ -21163,7 +21166,7 @@ var ts;
}
}
var targetType = type.flags & 16384 ? getApparentType(type) : type;
return isTypeSubtypeOf(candidate, targetType) ? candidate :
return isTypeSubtypeOf(candidate, type) ? candidate :
isTypeAssignableTo(type, candidate) ? type :
isTypeAssignableTo(candidate, targetType) ? candidate :
getIntersectionType([type, candidate]);
@ -28119,7 +28122,7 @@ var ts;
}
function moduleExportsSomeValue(moduleReferenceExpression) {
var moduleSymbol = resolveExternalModuleName(moduleReferenceExpression.parent, moduleReferenceExpression);
if (!moduleSymbol) {
if (!moduleSymbol || ts.isShorthandAmbientModuleSymbol(moduleSymbol)) {
return true;
}
var hasExportAssignment = hasExportAssignmentSymbol(moduleSymbol);

View File

@ -5636,11 +5636,14 @@ var ts;
(node.name.kind === 9 /* StringLiteral */ || isGlobalScopeAugmentation(node));
}
ts.isAmbientModule = isAmbientModule;
function isShorthandAmbientModuleSymbol(moduleSymbol) {
return isShorthandAmbientModule(moduleSymbol.valueDeclaration);
}
ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol;
function isShorthandAmbientModule(node) {
// The only kind of module that can be missing a body is a shorthand ambient module.
return node.kind === 225 /* ModuleDeclaration */ && (!node.body);
}
ts.isShorthandAmbientModule = isShorthandAmbientModule;
function isBlockScopedContainerTopLevel(node) {
return node.kind === 256 /* SourceFile */ ||
node.kind === 225 /* ModuleDeclaration */ ||
@ -17445,7 +17448,7 @@ var ts;
function getTargetOfImportClause(node) {
var moduleSymbol = resolveExternalModuleName(node, node.parent.moduleSpecifier);
if (moduleSymbol) {
var exportDefaultSymbol = ts.isShorthandAmbientModule(moduleSymbol.valueDeclaration) ?
var exportDefaultSymbol = ts.isShorthandAmbientModuleSymbol(moduleSymbol) ?
moduleSymbol :
moduleSymbol.exports["export="] ?
getPropertyOfType(getTypeOfSymbol(moduleSymbol.exports["export="]), "default") :
@ -17518,7 +17521,7 @@ var ts;
if (targetSymbol) {
var name_10 = specifier.propertyName || specifier.name;
if (name_10.text) {
if (ts.isShorthandAmbientModule(moduleSymbol.valueDeclaration)) {
if (ts.isShorthandAmbientModuleSymbol(moduleSymbol)) {
return moduleSymbol;
}
var symbolFromVariable = void 0;
@ -19549,7 +19552,7 @@ var ts;
function getTypeOfFuncClassEnumModule(symbol) {
var links = getSymbolLinks(symbol);
if (!links.type) {
if (symbol.valueDeclaration.kind === 225 /* ModuleDeclaration */ && ts.isShorthandAmbientModule(symbol.valueDeclaration)) {
if (symbol.valueDeclaration.kind === 225 /* ModuleDeclaration */ && ts.isShorthandAmbientModuleSymbol(symbol)) {
links.type = anyType;
}
else {
@ -24454,7 +24457,7 @@ var ts;
// type. Otherwise, the types are completely unrelated, so narrow to an intersection of the
// two types.
var targetType = type.flags & 16384 /* TypeParameter */ ? getApparentType(type) : type;
return isTypeSubtypeOf(candidate, targetType) ? candidate :
return isTypeSubtypeOf(candidate, type) ? candidate :
isTypeAssignableTo(type, candidate) ? type :
isTypeAssignableTo(candidate, targetType) ? candidate :
getIntersectionType([type, candidate]);
@ -33082,8 +33085,8 @@ var ts;
}
function moduleExportsSomeValue(moduleReferenceExpression) {
var moduleSymbol = resolveExternalModuleName(moduleReferenceExpression.parent, moduleReferenceExpression);
if (!moduleSymbol) {
// module not found - be conservative
if (!moduleSymbol || ts.isShorthandAmbientModuleSymbol(moduleSymbol)) {
// If the module is not found or is shorthand, assume that it may export a value.
return true;
}
var hasExportAssignment = hasExportAssignmentSymbol(moduleSymbol);

View File

@ -5636,11 +5636,14 @@ var ts;
(node.name.kind === 9 /* StringLiteral */ || isGlobalScopeAugmentation(node));
}
ts.isAmbientModule = isAmbientModule;
function isShorthandAmbientModuleSymbol(moduleSymbol) {
return isShorthandAmbientModule(moduleSymbol.valueDeclaration);
}
ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol;
function isShorthandAmbientModule(node) {
// The only kind of module that can be missing a body is a shorthand ambient module.
return node.kind === 225 /* ModuleDeclaration */ && (!node.body);
}
ts.isShorthandAmbientModule = isShorthandAmbientModule;
function isBlockScopedContainerTopLevel(node) {
return node.kind === 256 /* SourceFile */ ||
node.kind === 225 /* ModuleDeclaration */ ||
@ -17445,7 +17448,7 @@ var ts;
function getTargetOfImportClause(node) {
var moduleSymbol = resolveExternalModuleName(node, node.parent.moduleSpecifier);
if (moduleSymbol) {
var exportDefaultSymbol = ts.isShorthandAmbientModule(moduleSymbol.valueDeclaration) ?
var exportDefaultSymbol = ts.isShorthandAmbientModuleSymbol(moduleSymbol) ?
moduleSymbol :
moduleSymbol.exports["export="] ?
getPropertyOfType(getTypeOfSymbol(moduleSymbol.exports["export="]), "default") :
@ -17518,7 +17521,7 @@ var ts;
if (targetSymbol) {
var name_10 = specifier.propertyName || specifier.name;
if (name_10.text) {
if (ts.isShorthandAmbientModule(moduleSymbol.valueDeclaration)) {
if (ts.isShorthandAmbientModuleSymbol(moduleSymbol)) {
return moduleSymbol;
}
var symbolFromVariable = void 0;
@ -19549,7 +19552,7 @@ var ts;
function getTypeOfFuncClassEnumModule(symbol) {
var links = getSymbolLinks(symbol);
if (!links.type) {
if (symbol.valueDeclaration.kind === 225 /* ModuleDeclaration */ && ts.isShorthandAmbientModule(symbol.valueDeclaration)) {
if (symbol.valueDeclaration.kind === 225 /* ModuleDeclaration */ && ts.isShorthandAmbientModuleSymbol(symbol)) {
links.type = anyType;
}
else {
@ -24454,7 +24457,7 @@ var ts;
// type. Otherwise, the types are completely unrelated, so narrow to an intersection of the
// two types.
var targetType = type.flags & 16384 /* TypeParameter */ ? getApparentType(type) : type;
return isTypeSubtypeOf(candidate, targetType) ? candidate :
return isTypeSubtypeOf(candidate, type) ? candidate :
isTypeAssignableTo(type, candidate) ? type :
isTypeAssignableTo(candidate, targetType) ? candidate :
getIntersectionType([type, candidate]);
@ -33082,8 +33085,8 @@ var ts;
}
function moduleExportsSomeValue(moduleReferenceExpression) {
var moduleSymbol = resolveExternalModuleName(moduleReferenceExpression.parent, moduleReferenceExpression);
if (!moduleSymbol) {
// module not found - be conservative
if (!moduleSymbol || ts.isShorthandAmbientModuleSymbol(moduleSymbol)) {
// If the module is not found or is shorthand, assume that it may export a value.
return true;
}
var hasExportAssignment = hasExportAssignmentSymbol(moduleSymbol);