mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-04 04:58:00 +00:00
bug 311022: Don't recreate wrappers that already exist. r=jst sr=bzbarsky
This commit is contained in:
parent
07e6aa61a6
commit
c45204aeea
@ -309,6 +309,12 @@ RewrapIfDeepWrapper(JSContext *cx, JSObject *obj, jsval v, jsval *rval)
|
||||
#ifdef DEBUG_XPCNativeWrapper
|
||||
printf("Rewrapping for deep explicit wrapper\n");
|
||||
#endif
|
||||
if (wrappedNative == XPCNativeWrapper::GetWrappedNative(cx, obj)) {
|
||||
// Already wrapped, return the wrapper.
|
||||
*rval = OBJECT_TO_JSVAL(obj);
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
// |obj| is an explicit deep wrapper. We want to construct another
|
||||
// explicit deep wrapper for |v|. Just call XPCNativeWrapperCtor by hand
|
||||
// (passing null as the pre-created object it doesn't use anyway) so we
|
||||
|
Loading…
x
Reference in New Issue
Block a user