Skip to content

Commit

Permalink
fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
plantain-00 committed Sep 15, 2016
1 parent 2315694 commit 8d028c5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/compiler/checker.ts
Expand Up @@ -14237,7 +14237,7 @@ namespace ts {
}

function checkGrammarStaticPropertyOrMethodName(node: ClassElement) {
if (node.flags & NodeFlags.Static) {
if (node.flags & ModifierFlags.Static) {
if (node.kind === SyntaxKind.PropertyDeclaration) {
return checkGrammarStaticMemberName(node, ((node as ClassElement).name as Identifier).text);
}
Expand All @@ -14256,9 +14256,9 @@ namespace ts {
const forbiddenNames = ["length", "name", "arguments", "caller"];
if (forbiddenNames.indexOf(name) !== -1) {
if (languageVersion < ScriptTarget.ES6) {
return grammarErrorOnNode(node, Diagnostics._0_is_not_allowed_to_be_used_as_a_name_of_a_static_property_or_method_in_a_class_for_target_es5_2696, name);
return grammarErrorOnNode(node, Diagnostics._0_is_not_allowed_to_be_used_as_a_name_of_a_static_property_or_method_in_a_class_for_target_ES5, name);
} else {
return grammarErrorOnNode(node, Diagnostics._0_is_not_allowed_to_be_used_as_a_name_of_a_static_property_in_a_class_for_target_es6_and_higher_2697, name);
return grammarErrorOnNode(node, Diagnostics._0_is_not_allowed_to_be_used_as_a_name_of_a_static_property_in_a_class_for_target_ES6_and_higher, name);
}
}

Expand Down Expand Up @@ -19746,7 +19746,7 @@ namespace ts {

if (computedPropertyName.expression.kind === SyntaxKind.StringLiteral) {
const member = computedPropertyName.parent.parent.parent;
if (member.flags & NodeFlags.Static && member.kind === SyntaxKind.PropertyDeclaration) {
if (member.flags & ModifierFlags.Static && member.kind === SyntaxKind.PropertyDeclaration) {
return checkGrammarStaticMemberName(computedPropertyName, (computedPropertyName.expression as StringLiteral).text);
}
}
Expand Down

0 comments on commit 8d028c5

Please sign in to comment.