Bug 776328 - Only create holders for WNs. r=mrbkap

This commit is contained in:
Bobby Holley 2012-08-10 10:19:51 +02:00
parent 321507e668
commit 480c7597d4
3 changed files with 20 additions and 5 deletions

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<script>
function boom()
{
var div = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');
Components.lookupMethod(div.childNodes, "xx");
}
</script>
<body onload="boom();"></body>

View File

@ -43,4 +43,5 @@ load 761831.html
asserts(0-1) load 752038.html # We may hit bug 645229 here. asserts(0-1) load 752038.html # We may hit bug 645229 here.
asserts(1) load 753162.html # We hit bug 675518 or bug 680086 here. asserts(1) load 753162.html # We hit bug 675518 or bug 680086 here.
load 754311.html load 754311.html
load 776328.html
load 776333.html load 776333.html

View File

@ -614,11 +614,14 @@ WrapperFactory::WrapForSameCompartmentXray(JSContext *cx, JSObject *obj)
if (!wrapperObj) if (!wrapperObj)
return NULL; return NULL;
// Make the holder. // Make the holder. Note that this is currently for WNs only until we fix
JSObject *xrayHolder = XrayUtils::createHolder(cx, obj, parent); // bug 761704.
if (!xrayHolder) if (type == XrayForWrappedNative) {
return nullptr; JSObject *xrayHolder = XrayUtils::createHolder(cx, obj, parent);
js::SetProxyExtra(wrapperObj, 0, js::ObjectValue(*xrayHolder)); if (!xrayHolder)
return nullptr;
js::SetProxyExtra(wrapperObj, 0, js::ObjectValue(*xrayHolder));
}
return wrapperObj; return wrapperObj;
} }