Skip to content

Commit acc9a46

Browse files
committed
Don't raise an exception on JavaScript warnings
1 parent b498a98 commit acc9a46

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

spidermonkey/error.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,14 @@ add_frame(const char* srcfile, const char* funcname, int linenum)
7575
void
7676
report_error_cb(JSContext* cx, const char* message, JSErrorReport* report)
7777
{
78+
/* Subtle note about JSREPORT_EXCEPTION: it triggers whenever exceptions
79+
* are raised, even if they're caught and the Mozilla docs say you can
80+
* ignore it.
81+
*/
82+
/* TODO What should we do about warnings? A callback somehow? */
83+
if (report->flags & JSREPORT_WARNING)
84+
return;
85+
7886
const char* srcfile = report->filename;
7987
const char* mesg = message;
8088

0 commit comments

Comments
 (0)