Implement object merge operator
This commit is contained in:
parent
334ce73755
commit
b1b7885507
|
@ -166,6 +166,7 @@ module.exports = {
|
|||
let hasOverrides = bindings.some((binding) => binding.name === "__overrides");
|
||||
|
||||
if (isRecursive) {
|
||||
// __overrides is only respected in recursive attribute sets, in the upstream implementation
|
||||
if (hasOverrides) {
|
||||
throw new Error(`The __overrides feature is not supported in jsNix`);
|
||||
}
|
||||
|
|
|
@ -75,6 +75,11 @@ let trivial = {
|
|||
// FIXME: Need to replace this with utility functions to deal with eg. paths
|
||||
if (node.operator === "&&" || node.operator === "||") {
|
||||
return types.logicalExpression(node.operator, node.left, node.right);
|
||||
} if (node.operator === "//") {
|
||||
return types.objectExpression([
|
||||
types.spreadElement(node.left),
|
||||
types.spreadElement(node.right)
|
||||
]);
|
||||
} else {
|
||||
return types.binaryExpression(node.operator, node.left, node.right);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue