Skip to content

Commit

Permalink
Rename squirrel_away_unboxed to squirrel_away_unique.(fixes #1938)
Browse files Browse the repository at this point in the history
  • Loading branch information
lpy committed Mar 20, 2014
1 parent 6040271 commit 34b7383
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/components/script/dom/bindings/codegen/CodegenRust.py
Expand Up @@ -2068,7 +2068,7 @@ def CreateBindingJSObject(descriptor, parent=None):
let handler = js_info.get().get_ref().dom_static.proxy_handlers.get(&(PrototypeList::id::%s as uint));
""" % descriptor.name
create += handler + """ let obj = NewProxyObject(aCx, *handler,
&PrivateValue(squirrel_away_unboxed(aObject) as *libc::c_void),
&PrivateValue(squirrel_away_unique(aObject) as *libc::c_void),
proto, %s,
ptr::null(), ptr::null());
assert!(obj.is_not_null());
Expand All @@ -2082,7 +2082,7 @@ def CreateBindingJSObject(descriptor, parent=None):
create += """ assert!(obj.is_not_null());
JS_SetReservedSlot(obj, DOM_OBJECT_SLOT as u32,
PrivateValue(squirrel_away_unboxed(aObject) as *libc::c_void));
PrivateValue(squirrel_away_unique(aObject) as *libc::c_void));
"""
return create

Expand Down Expand Up @@ -4793,7 +4793,7 @@ def makeEnumTypedef(e):
'dom::bindings::utils::{NativePropertyHooks}',
'dom::bindings::utils::global_object_for_js_object',
'dom::bindings::utils::{Reflectable}',
'dom::bindings::utils::{squirrel_away_unboxed}',
'dom::bindings::utils::{squirrel_away_unique}',
'dom::bindings::utils::{ThrowingConstructor, unwrap, unwrap_jsmanaged}',
'dom::bindings::utils::{unwrap_object, VoidVal, with_gc_disabled}',
'dom::bindings::utils::{with_gc_enabled, XrayResolveProperty}',
Expand Down
4 changes: 2 additions & 2 deletions src/components/script/dom/bindings/utils.rs
Expand Up @@ -135,7 +135,7 @@ pub fn unwrap_value<T>(val: *JSVal, proto_id: PrototypeList::id::ID, proto_depth
}
}

pub unsafe fn squirrel_away_unboxed<T>(x: ~T) -> *T {
pub unsafe fn squirrel_away_unique<T>(x: ~T) -> *T {
cast::transmute(x)
}

Expand Down Expand Up @@ -409,7 +409,7 @@ pub extern fn ThrowingConstructor(_cx: *JSContext, _argc: c_uint, _vp: *mut JSVa
pub fn initialize_global(global: *JSObject) {
let protoArray = ~([0 as *JSObject, ..PrototypeList::id::IDCount as uint]);
unsafe {
let box_ = squirrel_away_unboxed(protoArray);
let box_ = squirrel_away_unique(protoArray);
JS_SetReservedSlot(global,
DOM_PROTOTYPE_SLOT,
PrivateValue(box_ as *libc::c_void));
Expand Down

5 comments on commit 34b7383

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging lpy/servo/issue1938 = 34b7383 into auto

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lpy/servo/issue1938 = 34b7383 merged ok, testing candidate = 19a7c42

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 19a7c42

Please sign in to comment.