-
Type:
Bug
-
Resolution: Done
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
ALL
-
None
-
None
-
None
-
None
-
None
-
None
-
None
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.