From ce2c24657606fc9684146817f03ecd0e94f89114 Mon Sep 17 00:00:00 2001 From: "jst@mozilla.org" Date: Wed, 13 Feb 2008 22:11:36 -0800 Subject: [PATCH] Fixing bug 417266. Don't call IsEventName() with non-string jsvals. r+sr=jonas@sicking.cc --- dom/src/base/nsDOMClassInfo.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/dom/src/base/nsDOMClassInfo.cpp b/dom/src/base/nsDOMClassInfo.cpp index e2f7fd2e06a7..9fcfad68ab2d 100644 --- a/dom/src/base/nsDOMClassInfo.cpp +++ b/dom/src/base/nsDOMClassInfo.cpp @@ -4601,17 +4601,18 @@ nsWindowSH::SetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx, return NS_FAILED(rv) ? rv : NS_SUCCESS_I_DID_SOMETHING; } - // Let the event receiver helper deal with event handler properties, - // all other properties that make it here are handled below. - if (IsEventName(id)) { - return nsEventReceiverSH::SetProperty(wrapper, cx, obj, id, vp, _retval); - } + if (JSVAL_IS_STRING(id)) { + // Let the event receiver helper deal with event handler + // properties, all other properties that make it here are handled + // below. + if (IsEventName(id)) { + return nsEventReceiverSH::SetProperty(wrapper, cx, obj, id, vp, _retval); + } - if (win->IsInnerWindow()) { - // Define a fast expando so that we can access this global script - // defined property w/o going through XPConnect. + if (win->IsInnerWindow()) { + // Define a fast expando so that we can access this global script + // defined property w/o going through XPConnect. - if (JSVAL_IS_STRING(id)) { JSString *str = JSVAL_TO_STRING(id); ::JS_DefineUCProperty(cx, obj, ::JS_GetStringChars(str),