conciseMethodProperty transform seems to throw error when using a computed key
I'm getting an error with the following code sample:
const keys = {
reset: 'RESET'
}
const otherThing = {
[keys.reset](state, next) {
return next
}
}
Stack trace:
TypeError: Cannot read property 'replace' of undefined
at Object.createIdentifier (/usr/local/lib/node_modules/buble/dist/buble.deps.js:8014:6)
at Property.transpile (/usr/local/lib/node_modules/buble/dist/buble.deps.js:7244:41)
at /usr/local/lib/node_modules/buble/dist/buble.deps.js:5465:61
at Array.forEach (native)
at ObjectExpression.transpile (/usr/local/lib/node_modules/buble/dist/buble.deps.js:5465:12)
at ObjectExpression.transpile (/usr/local/lib/node_modules/buble/dist/buble.deps.js:7117:30)
at ExportDefaultDeclaration.transpile (/usr/local/lib/node_modules/buble/dist/buble.deps.js:5467:12)
at /usr/local/lib/node_modules/buble/dist/buble.deps.js:5465:61
at Array.forEach (native)
at BlockStatement.transpile (/usr/local/lib/node_modules/buble/dist/buble.deps.js:5465:12)
Adding :function
seems to address the problem:
const keys = {
reset: 'RESET'
}
const otherThing = {
[keys.reset]: function (state, next) {
return next
}
}
Not a huge deal, but if it's compliant with the spec it would be cool for this to work.