As reported by fabio in #4629, when bartering the following warning occurs:
WARNING: JavaScript warning: gui/common/l10n.js line 12 reference to undefined property resources[type]
(The replay happens to reprodue this GUI issue, but that shouldn't matter.)
if (x.y) does not throw an error whereas filter(x => x.y) does (if y is not a property of x).
So we can use filter(x => x.y ? true : false), filter(x => !!x.y), filter(x => x.y || false) or use a for loop.
The resource trickle one would have the same issue in case the simulation doesn't enforce a rate for each resource anymore, so fixing that too would be better.