[SERVER-3615] for v8 invoke, if this does not exists, should be set to global obj Created: 16/Aug/11  Updated: 11/Jul/16  Resolved: 13/Sep/11

Status: Closed
Project: Core Server
Component/s: JavaScript
Affects Version/s: 1.8.2, 1.8.3
Fix Version/s: 2.1.0

Type: Bug Priority: Major - P3
Reporter: Bernie Hackett Assignee: Antoine Girbal
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File v8_test.py    
Issue Links:
Related
is related to PYTHON-274 Test failure: test_system_js (test.te... Closed
Operating System: ALL
Participants:

 Description   

I'll preface this by saying I can't figure out how to write a JS repro script since the shell doesn't support a CodeWScope type (SERVER-3391) and I can't figure out how to pass named variables in db.eval().

All that aside, I've attached a simple python script to reproduce although you need pymongo installed or have PYTHONPATH set to it's home.

In 1.8.x and in master (there isn't currently a 1.9.2 tag) the mongod log shows the following error:

Tue Aug 16 10:45:04 [conn26] warning: CodeWScope doesn't transfer to db.eval
Tue Aug 16 10:45:04 [conn26] error in invoke: _funcs1:1 TypeError: Cannot read property 'apply' of undefined
_funcs1 = function()

{ return this[name].apply(this, arguments); }

^

This all works fine with spidermonkey. This came up in PYTHON-274.



 Comments   
Comment by auto [ 13/Sep/11 ]

Author:

{u'login': u'agirbal', u'name': u'agirbal', u'email': u'antoine@10gen.com'}

Message: SERVER-3615: for v8 invoke, if this does not exists, should be set to global obj
Branch: master
https://github.com/mongodb/mongo/commit/468e1dde9c309791972f0f5d576266c9d8744336

Comment by Eliot Horowitz (Inactive) [ 16/Aug/11 ]

Just as a note - v8 isn't supported right now.

Generated at Thu Feb 08 03:03:32 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.