File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -4093,7 +4093,7 @@ module ts {
40934093 }
40944094
40954095 function isNumericName ( name : string ) {
4096- return ! isNaN ( < number > < any > name ) ;
4096+ return ( name !== "" ) && ! isNaN ( < number > < any > name ) ;
40974097 }
40984098
40994099 function checkObjectLiteral ( node : ObjectLiteral , contextualMapper ?: TypeMapper ) : Type {
@@ -6639,10 +6639,10 @@ module ts {
66396639 var ambient = isInAmbientContext ( node ) ;
66406640
66416641 forEach ( node . members , member => {
6642- // todo: remove first check here when isNumericName gets fixed
6643- if ( ! ( member . name . text === "" ) && isNumericName ( member . name . text ) ) {
6644- error ( member . name , Diagnostics . An_enum_member_cannot_have_a_numeric_name ) ;
6645- }
6642+ // todo: remove first check here when isNumericName gets fixed
6643+ if ( isNumericName ( member . name . text ) ) {
6644+ error ( member . name , Diagnostics . An_enum_member_cannot_have_a_numeric_name ) ;
6645+ }
66466646 var initializer = member . initializer ;
66476647 if ( initializer ) {
66486648 autoValue = getConstantValueForExpression ( initializer ) ;
You can’t perform that action at this time.
0 commit comments