Accept string or number as name of an accessor.
[not sure I'm happy about this fix] Reference mishoo/UglifyJS#478
This commit is contained in:
13
lib/parse.js
13
lib/parse.js
@@ -881,11 +881,14 @@ function parse($TEXT, options) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
var function_ = function(in_statement, ctor) {
|
var function_ = function(in_statement, ctor) {
|
||||||
var name = is("name") ? as_symbol(in_statement
|
var is_accessor = ctor === AST_Accessor;
|
||||||
? AST_SymbolDefun
|
var name = (is("name") ? as_symbol(in_statement
|
||||||
: ctor === AST_Accessor
|
? AST_SymbolDefun
|
||||||
? AST_SymbolAccessor
|
: is_accessor
|
||||||
: AST_SymbolLambda) : null;
|
? AST_SymbolAccessor
|
||||||
|
: AST_SymbolLambda)
|
||||||
|
: is_accessor && (is("string") || is("num")) ? as_atom_node()
|
||||||
|
: null);
|
||||||
if (in_statement && !name)
|
if (in_statement && !name)
|
||||||
unexpected();
|
unexpected();
|
||||||
expect("(");
|
expect("(");
|
||||||
|
|||||||
Reference in New Issue
Block a user