diff --git a/lib/6to5/transformers/jsx/index.js b/lib/6to5/transformers/jsx/index.js index be34943581..14ae97c7c0 100644 --- a/lib/6to5/transformers/jsx/index.js +++ b/lib/6to5/transformers/jsx/index.js @@ -87,17 +87,10 @@ exports.XJSElement = { var children = node.children; var args = callExpr.arguments; - switch (children.length) { - case 0: - break; - - case 1: - args.push(children[0]); - break; - - default: - args.push(b.arrayExpression(children)); - } + _.each(children, function (child) { + delete child.raw; + callExpr.arguments.push(child); + }); callExpr.loc = node.loc; return callExpr; diff --git a/test/fixtures/syntax/jsx/expressions/expected.js b/test/fixtures/syntax/jsx/expressions/expected.js index d3818d86d3..ff1185a7ba 100644 --- a/test/fixtures/syntax/jsx/expressions/expected.js +++ b/test/fixtures/syntax/jsx/expressions/expected.js @@ -1,8 +1,8 @@ "use strict"; X(null, a); -X(null, [a, " ", b]); +X(null, a, " ", b); X({ prop: a, yes: true -}); \ No newline at end of file +}); diff --git a/test/fixtures/syntax/jsx/tags-with-children/expected.js b/test/fixtures/syntax/jsx/tags-with-children/expected.js index 1183f4a58a..7af3674f0f 100644 --- a/test/fixtures/syntax/jsx/tags-with-children/expected.js +++ b/test/fixtures/syntax/jsx/tags-with-children/expected.js @@ -6,4 +6,4 @@ X({ X({ prop: "2" -}, [Y(null), Z(null)]); \ No newline at end of file +}, Y(null), Z(null));