set loose property assignments to computed if it's a literal

This commit is contained in:
Sebastian McKenzie 2015-02-17 10:45:24 +11:00
parent 5bd75db0b6
commit bf2418db66

View File

@ -51,7 +51,7 @@ var loose = function (node, body, objId) {
body.push(t.expressionStatement(
t.assignmentExpression(
"=",
t.memberExpression(objId, prop.key, prop.computed),
t.memberExpression(objId, prop.key, prop.computed || t.isLiteral(prop.key)),
prop.value
)
));