[SERVER-8356] $where does not report JavaScript error text in V8 build Created: 28/Jan/13  Updated: 11/Jul/16  Resolved: 13/Feb/13

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 2.4.0-rc1

Type: Bug Priority: Major - P3
Reporter: Tad Marshall Assignee: Ben Becker
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 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.



 Comments   
Comment by Tad Marshall [ 13/Feb/13 ]

Fixed by work on SERVER-8234

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