fixed some indentation quirks, comments

This commit is contained in:
Arthur Ozga 2015-06-19 16:20:00 -07:00
parent 933a2fa6df
commit 24da34c4ad

View file

@ -2003,7 +2003,7 @@ namespace ts {
// If the binding pattern is empty, this variable declaration is not visible
return false;
}
// Otherwise fall through
// Otherwise fall through
case SyntaxKind.ModuleDeclaration:
case SyntaxKind.ClassDeclaration:
case SyntaxKind.InterfaceDeclaration:
@ -4585,9 +4585,7 @@ namespace ts {
let sourceProp = getPropertyOfType(source, targetProp.name);
if (sourceProp === targetProp) { // source inherits targetProp and doesn't redeclare/override it.
if (source.flags & TypeFlags.Class && target.flags & TypeFlags.Class) {
let targetPropFlags = getDeclarationFlagsFromSymbol(targetProp);
let sourceDecl = getDeclarationOfKind(source.symbol, SyntaxKind.ClassDeclaration);
@ -6035,20 +6033,20 @@ namespace ts {
if (container && container.parent && container.parent.kind === SyntaxKind.ClassDeclaration) {
if (container.flags & NodeFlags.Static) {
canUseSuperExpression =
container.kind === SyntaxKind.MethodDeclaration ||
container.kind === SyntaxKind.MethodSignature ||
container.kind === SyntaxKind.GetAccessor ||
container.kind === SyntaxKind.SetAccessor;
container.kind === SyntaxKind.MethodDeclaration ||
container.kind === SyntaxKind.MethodSignature ||
container.kind === SyntaxKind.GetAccessor ||
container.kind === SyntaxKind.SetAccessor;
}
else {
canUseSuperExpression =
container.kind === SyntaxKind.MethodDeclaration ||
container.kind === SyntaxKind.MethodSignature ||
container.kind === SyntaxKind.GetAccessor ||
container.kind === SyntaxKind.SetAccessor ||
container.kind === SyntaxKind.PropertyDeclaration ||
container.kind === SyntaxKind.PropertySignature ||
container.kind === SyntaxKind.Constructor;
container.kind === SyntaxKind.MethodDeclaration ||
container.kind === SyntaxKind.MethodSignature ||
container.kind === SyntaxKind.GetAccessor ||
container.kind === SyntaxKind.SetAccessor ||
container.kind === SyntaxKind.PropertyDeclaration ||
container.kind === SyntaxKind.PropertySignature ||
container.kind === SyntaxKind.Constructor;
}
}
}
@ -7666,7 +7664,7 @@ namespace ts {
/**
* Performs typechecking on the given node, which is a call/new expression.
* @param node The call expression to be checked.
* @returns On success, the expression's signature's return type. On failure, any.
* @returns On success, the expression's signature's return type. On failure, anyType.
*/
function checkCallExpression(node: CallExpression): Type {
// Grammar checking; stop grammar-checking if checkGrammarTypeArguments return true
@ -8166,8 +8164,8 @@ namespace ts {
let type = isTypeAny(sourceType)
? sourceType
: getTypeOfPropertyOfType(sourceType, name.text) ||
isNumericLiteralName(name.text) && getIndexTypeOfType(sourceType, IndexKind.Number) ||
getIndexTypeOfType(sourceType, IndexKind.String);
isNumericLiteralName(name.text) && getIndexTypeOfType(sourceType, IndexKind.Number) ||
getIndexTypeOfType(sourceType, IndexKind.String);
if (type) {
checkDestructuringAssignment((<PropertyAssignment>p).initializer || name, type);
}
@ -8355,7 +8353,7 @@ namespace ts {
if (!checkForDisallowedESSymbolOperand(operator)) {
return booleanType;
}
// fall-through
// Otherwise fall through
case SyntaxKind.EqualsEqualsToken:
case SyntaxKind.ExclamationEqualsToken:
case SyntaxKind.EqualsEqualsEqualsToken:
@ -9578,7 +9576,7 @@ namespace ts {
case SyntaxKind.MethodDeclaration:
checkParameterTypeAnnotationsAsExpressions(<FunctionLikeDeclaration>node);
// fall-through
// Otherwise fall through
case SyntaxKind.SetAccessor:
case SyntaxKind.GetAccessor:
@ -10705,8 +10703,6 @@ namespace ts {
checkTypeAssignableTo(staticType, getTypeWithoutSignatures(staticBaseType), node.name || node,
Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1);
if (!(staticBaseType.symbol && staticBaseType.symbol.flags & SymbolFlags.Class)) {
// When the static base type is a "class-like" constructor function (but not actually a class), we verify
// that all instantiated base constructor signatures return the same type. We can simply compare the type
@ -10798,7 +10794,6 @@ namespace ts {
error(derivedClassDecl, Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_2,
typeToString(type), typeToString(baseType), symbolToString(baseProperty));
}
} else { // derived !== undefined -- derived overrides base
let derivedDeclarationFlags = getDeclarationFlagsFromSymbol(derived);
if ((baseDeclarationFlags & NodeFlags.Private) || (derivedDeclarationFlags & NodeFlags.Private)) {
@ -12088,7 +12083,7 @@ namespace ts {
(<ImportDeclaration>node.parent).moduleSpecifier === node)) {
return resolveExternalModuleName(node, <LiteralExpression>node);
}
// fall-through
// Otherwise fall through
case SyntaxKind.NumericLiteral:
// index access
@ -12261,7 +12256,7 @@ namespace ts {
if (links.isNestedRedeclaration === undefined) {
let container = getEnclosingBlockScopeContainer(symbol.valueDeclaration);
links.isNestedRedeclaration = isStatementWithLocals(container) &&
!!resolveName(container.parent, symbol.name, SymbolFlags.Value, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined);
!!resolveName(container.parent, symbol.name, SymbolFlags.Value, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined);
}
return links.isNestedRedeclaration;
}
@ -12512,11 +12507,11 @@ namespace ts {
//
// For rules on serializing type annotations, see `serializeTypeNode`.
switch (node.kind) {
case SyntaxKind.ClassDeclaration: return "Function";
case SyntaxKind.PropertyDeclaration: return serializeTypeNode((<PropertyDeclaration>node).type);
case SyntaxKind.Parameter: return serializeTypeNode((<ParameterDeclaration>node).type);
case SyntaxKind.GetAccessor: return serializeTypeNode((<AccessorDeclaration>node).type);
case SyntaxKind.SetAccessor: return serializeTypeNode(getSetAccessorTypeAnnotationNode(<AccessorDeclaration>node));
case SyntaxKind.ClassDeclaration: return "Function";
case SyntaxKind.PropertyDeclaration: return serializeTypeNode((<PropertyDeclaration>node).type);
case SyntaxKind.Parameter: return serializeTypeNode((<ParameterDeclaration>node).type);
case SyntaxKind.GetAccessor: return serializeTypeNode((<AccessorDeclaration>node).type);
case SyntaxKind.SetAccessor: return serializeTypeNode(getSetAccessorTypeAnnotationNode(<AccessorDeclaration>node));
}
if (isFunctionLike(node)) {
return "Function";