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

$where does not report JavaScript error text in V8 build

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 2.4.0-rc1
    • None
    • None
    • None
    • ALL

    Description

      In src/mongo/db/matcher.cpp at line 105, the code for handling errors in JavaScript invoked by "$where" is checking explicitly for a return code of -3, and will report "unknown error in invocation of $where function" for any other non-zero return value from _scope->invoke(). For a return code of -3 it will include the error text from the JavaScript failure.

      The SpiderMonkey interface code returned -3 for JavaScript errors, but the V8 interface code is returning 1 for all errors.

      Either the code in matcher.cpp should treat all non-zero return code the same (and include the error text) or the V8 interface code (V8Scope::invoke) should return -3 whenever it is providing error text.

      Attachments

        Activity

          People

            benjamin.becker Ben Becker
            tad Tad Marshall
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: