Bug 991016 - Check return value of a setDelegate call. r=efaust.

--HG--
extra : rebase_source : 052f55b4d10dc2a266b8cff6f94740e92b431624
This commit is contained in:
Jason Orendorff 2016-03-04 12:27:17 -06:00
parent ed98c1bc4b
commit d21cf14964

View File

@ -88,8 +88,10 @@ CrossCompartmentWrapper::getPrototype(JSContext* cx, HandleObject wrapper,
AutoCompartment call(cx, wrapped); AutoCompartment call(cx, wrapped);
if (!GetPrototype(cx, wrapped, protop)) if (!GetPrototype(cx, wrapped, protop))
return false; return false;
if (protop) if (protop) {
protop->setDelegate(cx); if (!protop->setDelegate(cx))
return false;
}
} }
return cx->compartment()->wrap(cx, protop); return cx->compartment()->wrap(cx, protop);