Bug 819745. Correctly handle body.onerror = null. r=peterv

This commit is contained in:
Boris Zbarsky 2012-12-10 14:31:25 -05:00
parent dcceb66959
commit 21c258072c
3 changed files with 10 additions and 2 deletions

View File

@ -0,0 +1,5 @@
<!doctype="html">
<body>
<script>
document.body.onerror = null;
</script>

View File

@ -43,3 +43,4 @@ load 795221-4.html
load 795221-5.xml
load 798802-1.html
load 811226.html
load 819745.html

View File

@ -1892,8 +1892,10 @@ nsGenericHTMLElement::SetOn##name_(EventHandlerNonNull* handler, \
\
nsCOMPtr<nsISupports> supports = do_QueryInterface(win); \
nsGlobalWindow* globalWin = nsGlobalWindow::FromSupports(supports); \
nsRefPtr<OnErrorEventHandlerNonNull> errorHandler = \
new OnErrorEventHandlerNonNull(handler); \
nsRefPtr<OnErrorEventHandlerNonNull> errorHandler; \
if (handler) { \
errorHandler = new OnErrorEventHandlerNonNull(handler); \
} \
return globalWin->SetOn##name_(errorHandler, error); \
} \
\