[SERVER-1119] Under v8, objects in map() have null value for .constructor Created: 14/May/10 Updated: 14/May/10 Resolved: 14/May/10 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 1.4.2 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Andy MacKinlay | Assignee: | Eliot Horowitz (Inactive) |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
OS X, with v8 build |
||
| Participants: |
| Description |
|
From my forum post at: Under V8, the 'this' object in the map function of a mapreduce call has a null value for .constructor. I'm not sure if this if malformed JS, or by design, but if it is by design, then it would be nice if tojson() could handle such objects (issue 1118) Reproducing the test case from the forum post: > rec = {foo: 'bar'} { "foo" : "bar" }> db.test_coll.save(rec) ; > var res = db.runCommand( {mapreduce: 'test_coll', map: mapTest, reduce: reduceTest, out: 'test_mr_out1', verbose: true}); , // works fine without tojson() call > mapTestFail = function() { ... print("in mapTest"); ... print(tojson(this)); ... emit('blah', 1); ... }; ); { It's likely that something out of this and 1118 is invalid, but I feel that at least one of them is probably a valid issue. |
| Comments |
| Comment by Eliot Horowitz (Inactive) [ 14/May/10 ] |
|
This is fine - fixed SERVER--1118 |