Accept keyword names as concise method names

This commit is contained in:
Fábio Santos
2015-10-26 23:24:04 +00:00
committed by Richard van Velzen
parent c99eaae360
commit 64e7a00399
2 changed files with 13 additions and 1 deletions

View File

@@ -1445,7 +1445,7 @@ function parse($TEXT, options) {
var start = S.token;
var type = start.type;
var name = as_property_name();
if (type == "name" && !is("punc", ":")) {
if (type != "string" && type != "num" && !is("punc", ":")) {
if (is("punc", "(")) {
a.push(new AST_ConciseMethod({
start : start,

View File

@@ -169,6 +169,18 @@ concise_methods_and_mangle_props: {
}
}
concise_methods_and_keyword_names: {
input: {
x = {
catch() {},
throw() {}
}
}
expect: {
x={catch(){},throw(){}};
}
}
number_literals: {
input: {
0b1001;