Commits

Ludvig Ericson  committed e998aed

Don't raise an exception on JavaScript warnings

  • Participants
  • Parent commits ec02542

Comments (0)

Files changed (1)

File spidermonkey/error.c

 void
 report_error_cb(JSContext* cx, const char* message, JSErrorReport* report)
 {
+    /* Subtle note about JSREPORT_EXCEPTION: it triggers whenever exceptions
+     * are raised, even if they're caught and the Mozilla docs say you can
+     * ignore it.
+     */
+    /* TODO What should we do about warnings? A callback somehow? */
+    if (report->flags & JSREPORT_WARNING)
+        return;
+
     const char* srcfile = report->filename;
     const char* mesg = message;