Accept keyword names as concise method names
This commit is contained in:
parent
c99eaae360
commit
64e7a00399
|
|
@ -1445,7 +1445,7 @@ function parse($TEXT, options) {
|
||||||
var start = S.token;
|
var start = S.token;
|
||||||
var type = start.type;
|
var type = start.type;
|
||||||
var name = as_property_name();
|
var name = as_property_name();
|
||||||
if (type == "name" && !is("punc", ":")) {
|
if (type != "string" && type != "num" && !is("punc", ":")) {
|
||||||
if (is("punc", "(")) {
|
if (is("punc", "(")) {
|
||||||
a.push(new AST_ConciseMethod({
|
a.push(new AST_ConciseMethod({
|
||||||
start : start,
|
start : start,
|
||||||
|
|
|
||||||
|
|
@ -169,6 +169,18 @@ concise_methods_and_mangle_props: {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
concise_methods_and_keyword_names: {
|
||||||
|
input: {
|
||||||
|
x = {
|
||||||
|
catch() {},
|
||||||
|
throw() {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
x={catch(){},throw(){}};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
number_literals: {
|
number_literals: {
|
||||||
input: {
|
input: {
|
||||||
0b1001;
|
0b1001;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user