Filed my first mozilla bug today, having verified that the strange behaviour I was seeing was in fact an error. It’s probably an open question as to whether this is a bug, a feature of an enhancement given the comments in the relevant bit of source:
// XXXwaterson Some day it would be cool to allow the 'predicate' // to be bound to a variable.
On the plus side, I’ve got an easy workaround, even if it isn’t as neat as my original solution.