Addressed PR. Diagnostic messages

This commit is contained in:
AbubakerB
2016-02-04 22:52:19 +00:00
parent 5ce0202bc9
commit 16b54e0d9f
2 changed files with 6 additions and 6 deletions

View File

@@ -10182,10 +10182,10 @@ namespace ts {
// A private or protected constructor can only be instantiated within it's own class
if (declaringClass !== enclosingClass) {
if (flags & NodeFlags.Private) {
error(node, Diagnostics.Constructor_of_type_0_is_private_and_only_accessible_within_class_1, signatureToString(signature), typeToString(declaringClass));
error(node, Diagnostics.Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration, typeToString(declaringClass));
}
if (flags & NodeFlags.Protected) {
error(node, Diagnostics.Constructor_of_type_0_is_protected_and_only_accessible_within_class_1, signatureToString(signature), typeToString(declaringClass));
error(node, Diagnostics.Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration, typeToString(declaringClass));
}
return false;
}
@@ -14059,7 +14059,7 @@ namespace ts {
if (signatures.length) {
const declaration = signatures[0].declaration;
if (declaration && declaration.flags & NodeFlags.Private) {
error(node, Diagnostics.Cannot_extend_private_class_0, (<Identifier>node.expression).text);
error(node, Diagnostics.Cannot_extend_a_class_0_Class_constructor_is_marked_as_private, (<Identifier>node.expression).text);
}
}
}

View File

@@ -1827,15 +1827,15 @@
"category": "Error",
"code": 2672
},
"Constructor of type '{0}' is private and only accessible within class '{1}'.": {
"Constructor of class '{0}' is private and only accessible within the class declaration.": {
"category": "Error",
"code": 2673
},
"Constructor of type '{0}' is protected and only accessible within class '{1}'.": {
"Constructor of class '{0}' is protected and only accessible within the class declaration.": {
"category": "Error",
"code": 2674
},
"Cannot extend private class '{0}'.": {
"Cannot extend a class '{0}'. Class constructor is marked as private.": {
"category": "Error",
"code": 2675
},