mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-11 16:32:59 +00:00
Bug 862610. When we have named constructors, make sure we managed to set up an interface object before looking for them. r=peterv
This commit is contained in:
parent
efe4d8a5a5
commit
5508e4bd90
@ -1786,6 +1786,9 @@ class CGDefineDOMInterfaceMethod(CGAbstractMethod):
|
|||||||
def definition_body(self):
|
def definition_body(self):
|
||||||
if len(self.descriptor.interface.namedConstructors) > 0:
|
if len(self.descriptor.interface.namedConstructors) > 0:
|
||||||
getConstructor = """ JSObject* interfaceObject = GetConstructorObject(aCx, aGlobal);
|
getConstructor = """ JSObject* interfaceObject = GetConstructorObject(aCx, aGlobal);
|
||||||
|
if (!interfaceObject) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
for (unsigned slot = DOM_INTERFACE_SLOTS_BASE; slot < JSCLASS_RESERVED_SLOTS(&InterfaceObjectClass.mBase); ++slot) {
|
for (unsigned slot = DOM_INTERFACE_SLOTS_BASE; slot < JSCLASS_RESERVED_SLOTS(&InterfaceObjectClass.mBase); ++slot) {
|
||||||
JSObject* constructor = &js::GetReservedSlot(interfaceObject, slot).toObject();
|
JSObject* constructor = &js::GetReservedSlot(interfaceObject, slot).toObject();
|
||||||
if (JS_GetFunctionId(JS_GetObjectFunction(constructor)) == JSID_TO_STRING(id)) {
|
if (JS_GetFunctionId(JS_GetObjectFunction(constructor)) == JSID_TO_STRING(id)) {
|
||||||
|
20
dom/bindings/crashtests/862610.html
Normal file
20
dom/bindings/crashtests/862610.html
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<script>
|
||||||
|
HTMLElement.prototype.__proto__ = Proxy.create({}, {});
|
||||||
|
try {
|
||||||
|
window.Image;
|
||||||
|
} finally {
|
||||||
|
// Restore our prototype so the test harnesses can deal with us
|
||||||
|
// We can't just assign to __proto__ because it lives on our proto chain
|
||||||
|
// and we messed that up.
|
||||||
|
var desc = Object.getOwnPropertyDescriptor(Object.prototype, "__proto__");
|
||||||
|
desc.set.call(HTMLElement.prototype, Element.prototype);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body></body>
|
||||||
|
</html>
|
@ -4,3 +4,4 @@ load 822340-2.html
|
|||||||
load 832899.html
|
load 832899.html
|
||||||
load 860591.html
|
load 860591.html
|
||||||
load 860551.html
|
load 860551.html
|
||||||
|
load 862610.html
|
||||||
|
Loading…
Reference in New Issue
Block a user