mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-21 01:05:45 +00:00
Fix for bug 762280 (Use nsContentUtils::PreserveWrapper for preserving expandos). r=bz.
--HG-- extra : rebase_source : cd426b3c3b987d8e39196e1dd1e468bc87e87f53
This commit is contained in:
parent
e45b10608b
commit
8d3d9a8f02
@ -596,14 +596,11 @@ class CGAddPropertyHook(CGAbstractClassHook):
|
||||
'JSBool', args)
|
||||
|
||||
def generate_code(self):
|
||||
return """
|
||||
JSCompartment* compartment = js::GetObjectCompartment(obj);
|
||||
xpc::CompartmentPrivate* priv =
|
||||
static_cast<xpc::CompartmentPrivate*>(JS_GetCompartmentPrivate(compartment));
|
||||
if (!priv->RegisterDOMExpandoObject(obj)) {
|
||||
return false;
|
||||
}
|
||||
self->SetPreservingWrapper(true);
|
||||
# FIXME https://bugzilla.mozilla.org/show_bug.cgi?id=774279
|
||||
# Using a real trace hook might enable us to deal with non-nsISupports
|
||||
# wrappercached things here.
|
||||
assert self.descriptor.nativeIsISupports
|
||||
return """ nsContentUtils::PreserveWrapper(reinterpret_cast<nsISupports*>(self), self);
|
||||
return true;"""
|
||||
|
||||
class CGClassFinalizeHook(CGAbstractClassHook):
|
||||
|
Loading…
Reference in New Issue
Block a user