use bitwise comparison

pull/3945/head
Rich Harris 6 years ago
parent b574b705a9
commit 8c50a443b0

@ -236,7 +236,7 @@ export default class Renderer {
.map((bits, i) => ({ bits, i })) .map((bits, i) => ({ bits, i }))
.filter(({ bits }) => bits) .filter(({ bits }) => bits)
.map(({ bits, i }) => x`${dirty}[${i}] & ${bits}`) .map(({ bits, i }) => x`${dirty}[${i}] & ${bits}`)
.reduce((lhs, rhs) => x`${lhs} || ${rhs}`); .reduce((lhs, rhs) => x`${lhs} | ${rhs}`);
({ operator, left, right } = expression); ({ operator, left, right } = expression);
} else { } else {

@ -109,12 +109,12 @@ export default {
assert.deepEqual(component.reads, { assert.deepEqual(component.reads, {
_0: 1, _0: 1,
_5: 2, _5: 3,
_6: 3, _6: 3,
_30: 1, _30: 1,
_31: 1, _31: 1,
_32: 1, _32: 1,
_36: 2, _36: 3,
_37: 3, _37: 3,
_40: 1 _40: 1
}); });

Loading…
Cancel
Save