diff --git a/dom/base/crashtests/708405-1.html b/dom/base/crashtests/708405-1.html new file mode 100644 index 00000000000..9fa92dedeaf --- /dev/null +++ b/dom/base/crashtests/708405-1.html @@ -0,0 +1,18 @@ + + + + + + + + diff --git a/dom/base/crashtests/crashtests.list b/dom/base/crashtests/crashtests.list index df492d86c85..0503d1f3648 100644 --- a/dom/base/crashtests/crashtests.list +++ b/dom/base/crashtests/crashtests.list @@ -33,3 +33,4 @@ load 693894.html load 695867.html load 697643.html load 706283-1.html +load 708405-1.html diff --git a/dom/base/nsDOMClassInfo.cpp b/dom/base/nsDOMClassInfo.cpp index 26e9b309f9a..411b6ee41c2 100644 --- a/dom/base/nsDOMClassInfo.cpp +++ b/dom/base/nsDOMClassInfo.cpp @@ -7974,12 +7974,19 @@ nsNamedArraySH::NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx, } JSObject *proto = ::JS_GetPrototype(cx, realObj); - JSBool hasProp; - if (proto && ::JS_HasPropertyById(cx, proto, id, &hasProp) && hasProp) { - // We found the property we're resolving on the prototype, - // nothing left to do here then. - return NS_OK; + if (proto) { + JSBool hasProp; + if (!::JS_HasPropertyById(cx, proto, id, &hasProp)) { + *_retval = false; + return NS_ERROR_FAILURE; + } + + if (hasProp) { + // We found the property we're resolving on the prototype, + // nothing left to do here then. + return NS_OK; + } } }