mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 708405. Make sure to propagate out failures from JS_HasPropertyById in the old nodelist resolve hook. r=mrbkap
This commit is contained in:
parent
d7ae89edea
commit
b4ae3f538d
18
dom/base/crashtests/708405-1.html
Normal file
18
dom/base/crashtests/708405-1.html
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
function boom()
|
||||||
|
{
|
||||||
|
var a = document.getElementsByTagName("div");
|
||||||
|
a.__proto__ = Proxy.create({has: function() { throw new Error; }});
|
||||||
|
for (var p in a) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body onload="boom();"></body>
|
||||||
|
</html>
|
@ -33,3 +33,4 @@ load 693894.html
|
|||||||
load 695867.html
|
load 695867.html
|
||||||
load 697643.html
|
load 697643.html
|
||||||
load 706283-1.html
|
load 706283-1.html
|
||||||
|
load 708405-1.html
|
||||||
|
@ -7974,12 +7974,19 @@ nsNamedArraySH::NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
JSObject *proto = ::JS_GetPrototype(cx, realObj);
|
JSObject *proto = ::JS_GetPrototype(cx, realObj);
|
||||||
JSBool hasProp;
|
|
||||||
|
|
||||||
if (proto && ::JS_HasPropertyById(cx, proto, id, &hasProp) && hasProp) {
|
if (proto) {
|
||||||
// We found the property we're resolving on the prototype,
|
JSBool hasProp;
|
||||||
// nothing left to do here then.
|
if (!::JS_HasPropertyById(cx, proto, id, &hasProp)) {
|
||||||
return NS_OK;
|
*_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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user