mirror of
https://github.com/servo/servo.git
synced 2025-06-19 22:59:03 +01:00
Introduce mutable/immutable variants of reflector() with named lifetimes, and kill unsafe casts.
This commit is contained in:
parent
e6be738d97
commit
c4bbc4cd37
24 changed files with 158 additions and 87 deletions
|
@ -2464,7 +2464,7 @@ class CGAbstractMethod(CGThing):
|
|||
|
||||
def CreateBindingJSObject(descriptor, parent=None):
|
||||
if descriptor.proxy:
|
||||
handler = """ //let reflector = ptr::to_unsafe_ptr(aObject.reflector());
|
||||
handler = """ //let reflector = aObject.mut_reflector();
|
||||
|
||||
let page = page_from_context(aCx);
|
||||
let handler = (*page).js_info.get_ref().dom_static.proxy_handlers.get(&(PrototypeList::id::%s as uint));
|
||||
|
@ -2520,7 +2520,7 @@ class CGWrapWithCacheMethod(CGAbstractMethod):
|
|||
return ptr::null();
|
||||
}
|
||||
|
||||
let reflector = ptr::to_mut_unsafe_ptr(aObject.reflector());
|
||||
let reflector = aObject.mut_reflector();
|
||||
%s
|
||||
|
||||
//NS_ADDREF(aObject);
|
||||
|
@ -2529,7 +2529,7 @@ class CGWrapWithCacheMethod(CGAbstractMethod):
|
|||
|
||||
return obj;""" % (CreateBindingJSObject(self.descriptor, "parent"))
|
||||
else:
|
||||
return """ let reflector = ptr::to_mut_unsafe_ptr(aObject.reflector());
|
||||
return """ let reflector = aObject.mut_reflector();
|
||||
%s
|
||||
let proto = GetProtoObject(aCx, obj, obj);
|
||||
JS_SetPrototype(aCx, obj, proto);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue