use t.toComputedKey in computed property name transformer
This commit is contained in:
@@ -44,7 +44,7 @@ exports.ObjectExpression = function (node, parent, file, scope) {
|
||||
broken = true;
|
||||
}
|
||||
|
||||
if (!broken || t.isLiteral(prop.key, { value: "__proto__" })) {
|
||||
if (!broken || t.isLiteral(t.toComputedKey(prop, prop.key), { value: "__proto__" })) {
|
||||
initProps.push(prop);
|
||||
props[i] = null;
|
||||
}
|
||||
@@ -61,6 +61,7 @@ exports.ObjectExpression = function (node, parent, file, scope) {
|
||||
var bodyNode;
|
||||
|
||||
if (prop.computed && t.isMemberExpression(key) && t.isIdentifier(key.object, { name: "Symbol" })) {
|
||||
// { [Symbol.iterator]: "foo" }
|
||||
bodyNode = t.assignmentExpression(
|
||||
"=",
|
||||
t.memberExpression(objId, key, true),
|
||||
|
||||
Reference in New Issue
Block a user