From 34a99930b18055dd9615cf509e69fafc15906e41 Mon Sep 17 00:00:00 2001 From: "sdwilsh%shawnwilsher.com" Date: Fri, 6 Jul 2007 01:38:56 +0000 Subject: [PATCH] Bug 374334 - Uncaught exception with cloneNode method and frameset element. Patch by Alex Vincent . r=jst,sr=jst --- content/events/src/nsEventListenerManager.cpp | 4 ++++ dom/src/base/nsJSEnvironment.cpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/content/events/src/nsEventListenerManager.cpp b/content/events/src/nsEventListenerManager.cpp index 5af2eda0227..6597d3a14fa 100644 --- a/content/events/src/nsEventListenerManager.cpp +++ b/content/events/src/nsEventListenerManager.cpp @@ -826,6 +826,10 @@ nsEventListenerManager::AddScriptEventListener(nsISupports *aObject, aBody, url.get(), lineNo, handler); + if (rv == NS_ERROR_ILLEGAL_VALUE) { + NS_WARNING("Probably a syntax error in the event handler!"); + return NS_SUCCESS_LOSS_OF_INSIGNIFICANT_DATA; + } NS_ENSURE_SUCCESS(rv, rv); // And bind it. rv = context->BindCompiledEventHandler(aObject, scope, diff --git a/dom/src/base/nsJSEnvironment.cpp b/dom/src/base/nsJSEnvironment.cpp index 27b5e4301d2..73027f51301 100644 --- a/dom/src/base/nsJSEnvironment.cpp +++ b/dom/src/base/nsJSEnvironment.cpp @@ -1671,7 +1671,7 @@ nsJSContext::CompileEventHandler(nsIAtom *aName, aURL, aLineNo); if (!fun) { - return NS_ERROR_FAILURE; + return NS_ERROR_ILLEGAL_VALUE; } JSObject *handler = ::JS_GetFunctionObject(fun);