Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-3615

for v8 invoke, if this does not exists, should be set to global obj

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.1.0
    • Affects Version/s: 1.8.2, 1.8.3
    • Component/s: JavaScript
    • Labels:
      None
    • ALL

      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.

            Assignee:
            antoine Antoine Girbal
            Reporter:
            bernie@mongodb.com Bernie Hackett
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: