apache/couchdb — pull request #127 by calvinmetcalf (2014-01-07 23:10:29+00:00)
Title: pass emit as an argument

allow the map function to be passed a second argument, the emit function. Benefits as I see them

- 100% backwards compatible, emit is still in the execution closure.
- makes it possible to run views in pure JavaScript without having to use eval (e.g. in pouchdb)
- allows emit to be renamed in the case of some sort of collision, the circumstances of which I can't imagine.

I can write tests if this is something worth pursuing, though at the moment I'm having troubling fathoming the ruby wrapped JavaScript testing format.

Thanks.