mongodb/node-mongodb-native — pull request #1096 by gregl83 (2013-09-17 01:01:49+00:00)
Title: MapReduce Scope Containing Multiple Objects

I ran into the scenario of needing to pass multiple modules/objects to my mapReduce job using the scope option.

```javascript
var options = {
...,
scope: {
A: {method: function() {}},
B: {method: function() {}}
},
...
};
```

With the current state of the processScope function I was unable to provide modules/objects as properties to the scope object. This is due to processScope NOT recursively wrapping ```Code(String( /* function */ ))``` around methods.

It was easy enough to make the function recursive and add tests.

Note: complex object structures would be traversed using this patch.