removed hidden tabs + moved check into isNumericName

This commit is contained in:
ChrisBubernak 2014-10-09 09:36:32 -07:00
parent 2b4f48996e
commit facd52f593

View File

@ -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);