add numericliteral

This commit is contained in:
Henry Zhu 2015-11-21 22:50:21 -05:00
parent 3a05513e31
commit f56af90c20
2 changed files with 3 additions and 3 deletions

View File

@ -478,7 +478,7 @@ defineType("ObjectMethod", {
},
key: {
validate(node, key, val) {
let expectedTypes = node.computed ? ["Expression"] : ["Identifier", "StringLiteral"];
let expectedTypes = node.computed ? ["Expression"] : ["Identifier", "StringLiteral", "NumericLiteral"];
assertNodeType(...expectedTypes)(node, key, val);
}
},
@ -510,7 +510,7 @@ defineType("ObjectProperty", {
},
key: {
validate(node, key, val) {
let expectedTypes = node.computed ? ["Expression"] : ["Identifier", "StringLiteral"];
let expectedTypes = node.computed ? ["Expression"] : ["Identifier", "StringLiteral", "NumericLiteral"];
assertNodeType(...expectedTypes)(node, key, val);
}
},

View File

@ -254,7 +254,7 @@ defineType("ClassMethod", {
},
key: {
validate(node, key, val) {
let expectedTypes = node.computed ? ["Expression"] : ["Identifier", "StringLiteral"];
let expectedTypes = node.computed ? ["Expression"] : ["Identifier", "StringLiteral", "NumericLiteral"];
assertNodeType(...expectedTypes)(node, key, val);
}
},