Simplify concat
This commit is contained in:
parent
b1f9097824
commit
767687b297
|
@ -167,13 +167,13 @@ class ContractSource {
|
||||||
|
|
||||||
let trueExpression = (node.trueBody && node.trueBody.statements && node.trueBody.statements[0]) || node.trueBody;
|
let trueExpression = (node.trueBody && node.trueBody.statements && node.trueBody.statements[0]) || node.trueBody;
|
||||||
if(trueExpression) {
|
if(trueExpression) {
|
||||||
children = children.concat([].concat(trueExpression));
|
children = children.concat(trueExpression);
|
||||||
trueExpression._parent = {type: 'b', id: node.id, idx: 0};
|
trueExpression._parent = {type: 'b', id: node.id, idx: 0};
|
||||||
}
|
}
|
||||||
|
|
||||||
let falseExpression = (node.falseBody && node.falseBody.statements && node.falseBody.statements[0]) || node.falseBody;
|
let falseExpression = (node.falseBody && node.falseBody.statements && node.falseBody.statements[0]) || node.falseBody;
|
||||||
if(falseExpression) {
|
if(falseExpression) {
|
||||||
children = children.concat([].concat(falseExpression));
|
children = children.concat(falseExpression);
|
||||||
falseExpression._parent = {type: 'b', id: node.id, idx: 1};
|
falseExpression._parent = {type: 'b', id: node.id, idx: 1};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue