diff --git a/mozilla/content/events/src/nsEventListenerManager.cpp b/mozilla/content/events/src/nsEventListenerManager.cpp index 5af2eda0227..6597d3a14fa 100644 --- a/mozilla/content/events/src/nsEventListenerManager.cpp +++ b/mozilla/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/mozilla/dom/src/base/nsJSEnvironment.cpp b/mozilla/dom/src/base/nsJSEnvironment.cpp index 27b5e4301d2..73027f51301 100644 --- a/mozilla/dom/src/base/nsJSEnvironment.cpp +++ b/mozilla/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);