Closed Bug 63672 Opened 24 years ago Closed 21 years ago

JS strict warnings execute onerror handlers...

Categories

(Core :: DOM: Core & HTML, defect, P2)

defect

Tracking

()

VERIFIED DUPLICATE of bug 220603
mozilla0.8

People

(Reporter: jst, Assigned: jst)

References

Details

Even if a page contains JS strict warnings the onerror handler should not be
called. onerror is for *errors*, not for warnings.
This patch makes mozilla not call the onerror handler for JS strict warnings:

Index: dom/src/base/nsJSEnvironment.cpp
===================================================================
RCS file: /cvsroot/mozilla/dom/src/base/nsJSEnvironment.cpp,v
retrieving revision 1.122
diff -u -r1.122 nsJSEnvironment.cpp
--- nsJSEnvironment.cpp 2000/12/07 02:08:21     1.122
+++ nsJSEnvironment.cpp 2000/12/25 00:20:39
@@ -96,7 +96,7 @@
       //send error event first, then proceed
       nsCOMPtr<nsIDocShell> docShell;
       globalObject->GetDocShell(getter_AddRefs(docShell));
-      if (docShell) {
+      if (docShell && !JSREPORT_IS_STRICT(report->flags)) {
         static PRInt32 errorDepth = 0; // Recursion prevention
         errorDepth++;
Status: NEW → ASSIGNED
Priority: -- → P2
Target Milestone: --- → mozilla0.8
Ok, turns out this is an invalid bug, if you want JS warnings to be treated as
errors then they will call the onerror handler.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → INVALID
Invalid
Status: RESOLVED → VERIFIED
*** Bug 118464 has been marked as a duplicate of this bug. ***
*** Bug 118464 has been marked as a duplicate of this bug. ***
*** Bug 137519 has been marked as a duplicate of this bug. ***
*** Bug 137519 has been marked as a duplicate of this bug. ***
Reopening.  This was reconsidered and fixed, recently.
Status: VERIFIED → REOPENED
Resolution: INVALID → ---

*** This bug has been marked as a duplicate of 220603 ***
Status: REOPENED → RESOLVED
Closed: 24 years ago21 years ago
Resolution: --- → DUPLICATE
*** Bug 118464 has been marked as a duplicate of this bug. ***
verified.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.