mongodb/node-mongodb-native — pull request #1165 by exabugs (2014-04-24 09:39:59+00:00)
Title: A 'mapReduce' function changed 'function' to instance '\<Object\>' of 'Code' class.

After mapReduce function executed with 'scope: {util: XXX}', the 'compare' function of XXX has been changed to an instance '\' of 'Code' class.

```javascript
var XXX = {
compare: function (a, b) {
return a == b ? 0 : a < b ? -1 : 1
}
}
```

```javascript
XXX.compare(1, 2); // -1
```

```javascript
collection.mapReduce(
map,
reduce,
{
scope: {util: XXX}
}
);
```

```javascript
XXX.compare(1, 2); // TypeError: Property 'compare' of object #