add test and fix for string literal case (#10578)
This commit is contained in:
committed by
Nicolò Ribaudo
parent
fe258dec04
commit
5b40845afe
@@ -281,7 +281,10 @@ export default {
|
||||
path.replaceWith(
|
||||
t.callExpression(state.addHelper("initializerDefineProperty"), [
|
||||
t.cloneNode(path.get("left.object").node),
|
||||
t.stringLiteral(path.get("left.property").node.name),
|
||||
t.stringLiteral(
|
||||
path.get("left.property").node.name ||
|
||||
path.get("left.property").node.value,
|
||||
),
|
||||
t.cloneNode(path.get("right.arguments")[0].node),
|
||||
t.cloneNode(path.get("right.arguments")[1].node),
|
||||
]),
|
||||
|
||||
Reference in New Issue
Block a user