GitHub user calvinmetcalf opened a pull request:
https://github.com/apache/couchdb/pull/127
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.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/calvinmetcalf/couchdb pass-arguments
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/couchdb/pull/127.patch
----
commit 161c2724b18d042c41ab9a5921209615ed7a4c96
Author: Calvin Metcalf <[email protected]>
Date: 2014-01-07T00:48:03Z
pass emit as an argument
----