Closed emilos closed 4 years ago
Right now the reduction method can only optimize a flat expression like:
{ type: 'BinaryExpression', operator: '+', left: { type: 'Literal', value: 'foo' }, right: { type: 'Literal', value: 'bar' } }
it would be great if it could optimize nested binary expressions too, e.g.:
{ type: 'BinaryExpression', operator: '+', left: { type: 'BinaryExpression', operator: '+', left: { type: 'Literal', value: 'foo' }, right: { type: 'Literal', value: 'bar' } }, right: { type: 'Literal', value: 'baz' } }
Right now the reduction method can only optimize a flat expression like:
it would be great if it could optimize nested binary expressions too, e.g.: