aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/codegen/CodegenRust.py
diff options
context:
space:
mode:
authorbors-servo <metajack+bors@gmail.com>2015-02-12 14:48:50 -0700
committerbors-servo <metajack+bors@gmail.com>2015-02-12 14:48:50 -0700
commit69259e9975a0383d309b7ce678734c49e6616d32 (patch)
tree7dc27210c3b956bf9d3663a44dbaa6ef02c87688 /components/script/dom/bindings/codegen/CodegenRust.py
parent6d1a2d90e531e82c8692af469f308e539d15bedb (diff)
parentb5440a62575ed22e5eeb95192ef4b0a3ad580cda (diff)
downloadservo-69259e9975a0383d309b7ce678734c49e6616d32.tar.gz
servo-69259e9975a0383d309b7ce678734c49e6616d32.zip
auto merge of #4910 : Ms2ger/servo/squirrel, r=jdm
Diffstat (limited to 'components/script/dom/bindings/codegen/CodegenRust.py')
-rw-r--r--components/script/dom/bindings/codegen/CodegenRust.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/components/script/dom/bindings/codegen/CodegenRust.py b/components/script/dom/bindings/codegen/CodegenRust.py
index edb64705c3e..858b77f88b1 100644
--- a/components/script/dom/bindings/codegen/CodegenRust.py
+++ b/components/script/dom/bindings/codegen/CodegenRust.py
@@ -1800,7 +1800,7 @@ def CreateBindingJSObject(descriptor, parent=None):
assert not descriptor.isGlobal()
create += """
let handler = RegisterBindings::proxy_handlers[PrototypeList::Proxies::%s as uint];
-let mut private = PrivateValue(squirrel_away_unique(object) as *const libc::c_void);
+let mut private = PrivateValue(boxed::into_raw(object) as *const libc::c_void);
let obj = with_compartment(cx, proto, || {
NewProxyObject(cx, handler,
&private,
@@ -1820,7 +1820,7 @@ assert!(!obj.is_null());\
assert!(!obj.is_null());
JS_SetReservedSlot(obj, DOM_OBJECT_SLOT as u32,
- PrivateValue(squirrel_away_unique(object) as *const libc::c_void));"""
+ PrivateValue(boxed::into_raw(object) as *const libc::c_void));"""
return create
class CGWrapMethod(CGAbstractMethod):
@@ -3978,7 +3978,7 @@ let this: *const %s = unwrap::<%s>(obj);
def finalizeHook(descriptor, hookName, context):
release = """\
let value = unwrap::<%s>(obj);
-let _: Box<%s> = mem::transmute(value);
+let _ = Box::from_raw(value as *mut %s);
debug!("%s finalize: {:p}", this);\
""" % (descriptor.concreteType, descriptor.concreteType, descriptor.concreteType)
return release
@@ -4557,7 +4557,6 @@ class CGBindingRoot(CGThing):
'dom::bindings::utils::has_property_on_prototype',
'dom::bindings::utils::is_platform_object',
'dom::bindings::utils::{Reflectable}',
- 'dom::bindings::utils::{squirrel_away_unique}',
'dom::bindings::utils::throwing_constructor',
'dom::bindings::utils::get_dictionary_property',
'dom::bindings::utils::{NativeProperties, NativePropertyHooks}',
@@ -4587,6 +4586,7 @@ class CGBindingRoot(CGThing):
'libc',
'util::str::DOMString',
'std::borrow::ToOwned',
+ 'std::boxed',
'std::cmp',
'std::iter::repeat',
'std::mem',