Address CR

This commit is contained in:
Yui T
2015-07-22 14:36:06 -07:00
parent 13aba26ced
commit 3270e71fcf
4 changed files with 8 additions and 6 deletions

View File

@@ -10250,11 +10250,13 @@ namespace ts {
// constructors of derived classes must contain at least one super call somewhere in their function body.
let containingClassDecl = <ClassDeclaration>node.parent;
if (getClassExtendsHeritageClauseElement(containingClassDecl)) {
let baseConstructorType = getBaseConstructorTypeOfClass(containingClassDecl);
let symbol = getSymbolOfNode(containingClassDecl);
let type = <InterfaceType>getDeclaredTypeOfSymbol(symbol);
let baseConstructorType = getBaseConstructorTypeOfClass(type);
if (containsSuperCall(node.body)) {
if (baseConstructorType === nullType) {
error(node, Diagnostics.A_constructor_can_not_contain_super_call_when_a_class_extends_null);
error(node, Diagnostics.A_constructor_cannot_contain_super_call_when_a_class_extends_null);
}
// The first statement in the body of a constructor must be a super call if both of the following are true:

View File

@@ -613,6 +613,6 @@ namespace ts {
Expected_corresponding_JSX_closing_tag_for_0: { code: 17002, category: DiagnosticCategory.Error, key: "Expected corresponding JSX closing tag for '{0}'." },
JSX_attribute_expected: { code: 17003, category: DiagnosticCategory.Error, key: "JSX attribute expected." },
Cannot_use_JSX_unless_the_jsx_flag_is_provided: { code: 17004, category: DiagnosticCategory.Error, key: "Cannot use JSX unless the '--jsx' flag is provided." },
A_constructor_can_not_contain_super_call_when_a_class_extends_null: { code: 17005, category: DiagnosticCategory.Error, key: "A constructor can not contain super call when a class extends null" },
A_constructor_cannot_contain_super_call_when_a_class_extends_null: { code: 17005, category: DiagnosticCategory.Error, key: "A constructor cannot contain 'super' call when a class extends 'null'" },
};
}

View File

@@ -2446,7 +2446,7 @@
"category": "Error",
"code": 17004
},
"A constructor can not contain super call when a class extends null": {
"A constructor cannot contain 'super' call when a class extends 'null'": {
"category": "Error",
"code": 17005
}