[SERVER-5034] strange object behavior in v8 shell Created: 22/Feb/12 Updated: 11/Jul/16 Resolved: 27/Feb/12 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | JavaScript |
| Affects Version/s: | None |
| Fix Version/s: | 2.1.1 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Aaron Staple | Assignee: | Antoine Girbal |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Operating System: | ALL | ||||||||
| Participants: | |||||||||
| Description |
|
When I run the following script, the v8 shell seems to think the "nscanned" field of the returned document is undefined. But if I printjson the document first (see commented line), the proper nscanned field is found. This seems to occur in the v8 shell only (not the sm shell). git version ab7b4dbb51ac7252ecf4a3525ead615ecc243bdb
Note the above test is a simplified version of my original test which had this issue. If you can't reproduce I can provide the original test. |
| Comments |
| Comment by auto [ 07/Mar/12 ] | |||||||||||||||||||||||
|
Author: {u'login': u'astaple', u'email': u'aaron@10gen.com', u'name': u'Aaron'}Message: | |||||||||||||||||||||||
| Comment by Antoine Girbal [ 27/Feb/12 ] | |||||||||||||||||||||||
|
Looks like setting key values to 'undefined' confuses the callbacks into C++. | |||||||||||||||||||||||
| Comment by auto [ 27/Feb/12 ] | |||||||||||||||||||||||
|
Author: {u'login': u'agirbal', u'name': u'agirbal', u'email': u'antoine@10gen.com'}Message: | |||||||||||||||||||||||
| Comment by Antoine Girbal [ 27/Feb/12 ] | |||||||||||||||||||||||
|
This issue is extremely odd. Did also the following test.
Now same with just a function that prints, no issue:
Trying with some debug prints, it appears that the named accessor in v8 wrapper is not called for that property. | |||||||||||||||||||||||
| Comment by auto [ 25/Feb/12 ] | |||||||||||||||||||||||
|
Author: {u'login': u'astaple', u'name': u'Aaron', u'email': u'aaron@10gen.com'}Message: |