John Resig: Unimpressed by NodeIterator
ejohn.org
ejohn.org
We recently tackled a similar issue in Cappuccino and our solution was to create two parallel ways of specifying this information that were transparently convertible: a pure bit flags version and a strings version, such that (Selected | Highlighted) is equivalent to "selected+highlighted". You can pass in either the string form or the bit form to the methods, and you can convert between them as well. All in all, none of the "JS people" using our framework seemed to mind the use of bit flags.
"And I can't think of a good reason to use entityReferenceExpansion=false..." It's all about the element of least surprise - are developers more likely to expect the syntax that they see on the page (e.g. &foo;) or something else in its place. Whatever the right answer is to that question should be made the default option and left as that.