push to arguments instead of an array literal for jsx children
This commit is contained in:
parent
035829e726
commit
1e6b8d80bb
@ -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;
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
"use strict";
|
||||
X(null, a);
|
||||
X(null, [a, " ", b]);
|
||||
X(null, a, " ", b);
|
||||
|
||||
X({
|
||||
prop: a,
|
||||
yes: true
|
||||
});
|
||||
});
|
||||
|
||||
@ -6,4 +6,4 @@ X({
|
||||
|
||||
X({
|
||||
prop: "2"
|
||||
}, [Y(null), Z(null)]);
|
||||
}, Y(null), Z(null));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user