Open devito opened 2 years ago
using v1.20.2
Describe the bug Found that nuglify indicates error when parsing an object shorthand initializer with a quoted method name:
const foo = { '*'() { }, };
const foo = { 'bar'() { }, }; Other styles of object initializing with quoted name work:
const foo = { 'bar'() { }, };
const foo = { ['*']() { }, };
const foo = { '*': function() { }, };
const foo = { bar() { }, };
To Reproduce https://gist.github.com/devito/1dae39b9c3c4913d7803784566dbe0e9
Minified output or stack trace
HasError is true with error message: input(1,15-18): run-time error JS1010: Expected identifier: '*'
Excepted output code HasError is false const foo={'*'(){}}
thats truly an odd syntax. Will take a look
using v1.20.2
Describe the bug Found that nuglify indicates error when parsing an object shorthand initializer with a quoted method name:
const foo = { '*'() { }, };
const foo = { 'bar'() { }, };
Other styles of object initializing with quoted name work:const foo = { ['*']() { }, };
const foo = { '*': function() { }, };
const foo = { bar() { }, };
To Reproduce https://gist.github.com/devito/1dae39b9c3c4913d7803784566dbe0e9
Minified output or stack trace
HasError is true with error message: input(1,15-18): run-time error JS1010: Expected identifier: '*'
Excepted output code HasError is false const foo={'*'(){}}