mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 08:11:30 -06:00
removed hidden tabs + moved check into isNumericName
This commit is contained in:
parent
2b4f48996e
commit
facd52f593
@ -4093,7 +4093,7 @@ module ts {
|
||||
}
|
||||
|
||||
function isNumericName(name: string) {
|
||||
return !isNaN(<number><any>name);
|
||||
return (name !== "") && !isNaN(<number><any>name);
|
||||
}
|
||||
|
||||
function checkObjectLiteral(node: ObjectLiteral, contextualMapper?: TypeMapper): Type {
|
||||
@ -6639,10 +6639,10 @@ module ts {
|
||||
var ambient = isInAmbientContext(node);
|
||||
|
||||
forEach(node.members, member => {
|
||||
// todo: remove first check here when isNumericName gets fixed
|
||||
if(!(member.name.text === "") && isNumericName(member.name.text)) {
|
||||
error(member.name, Diagnostics.An_enum_member_cannot_have_a_numeric_name);
|
||||
}
|
||||
// todo: remove first check here when isNumericName gets fixed
|
||||
if(isNumericName(member.name.text)) {
|
||||
error(member.name, Diagnostics.An_enum_member_cannot_have_a_numeric_name);
|
||||
}
|
||||
var initializer = member.initializer;
|
||||
if (initializer) {
|
||||
autoValue = getConstantValueForExpression(initializer);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user