fix: m/r emit error gets spidermonkey into bad state SERVER-570

This commit is contained in:
Eliot Horowitz
2010-01-26 10:42:28 -05:00
parent 41232b6557
commit a6d37a6d3e
2 changed files with 56 additions and 1 deletions

View File

@@ -818,7 +818,15 @@ namespace mongo {
a = args.obj();
}
BSONObj out = func( a );
BSONObj out;
try {
out = func( a );
}
catch ( std::exception& e ){
JS_ReportError( cx , e.what() );
return JS_FALSE;
}
if ( out.isEmpty() ){
*rval = JSVAL_VOID;