diff options
author | bors-servo <release+servo@mozilla.com> | 2014-04-27 18:52:39 -0400 |
---|---|---|
committer | bors-servo <release+servo@mozilla.com> | 2014-04-27 18:52:39 -0400 |
commit | 493aa2cdf30fb2ff5886c714030a20d714764b67 (patch) | |
tree | 513345ea70f134bf4a85d8e2cdbe166bfee904f6 /src/components/script/dom/bindings/callback.rs | |
parent | 4942cc76bd2c88e5fdc2b4de4c1ac4576100b455 (diff) | |
parent | 948daf242278b22d7a15c1c594129785d1cff538 (diff) | |
download | servo-493aa2cdf30fb2ff5886c714030a20d714764b67.tar.gz servo-493aa2cdf30fb2ff5886c714030a20d714764b67.zip |
auto merge of #2238 : mozilla/servo/rustup_20140410c, r=Ms2ger
r? @metajack
Note that all pending submodule PRs must be landed before this should be given r+.
Diffstat (limited to 'src/components/script/dom/bindings/callback.rs')
-rw-r--r-- | src/components/script/dom/bindings/callback.rs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/components/script/dom/bindings/callback.rs b/src/components/script/dom/bindings/callback.rs index a6d7eb6a507..1633ebb2411 100644 --- a/src/components/script/dom/bindings/callback.rs +++ b/src/components/script/dom/bindings/callback.rs @@ -8,8 +8,8 @@ use js::jsapi::{JS_GetProperty, JSTracer, JS_CallTracer}; use js::jsval::{JSVal, UndefinedValue}; use js::JSTRACE_OBJECT; +use libc; use std::cast; -use std::libc; use std::ptr; use serialize::{Encodable, Encoder}; @@ -27,11 +27,11 @@ pub enum ExceptionHandling { #[deriving(Clone,Eq)] pub struct CallbackInterface { - callback: *JSObject + pub callback: *JSObject } -impl<S: Encoder> Encodable<S> for CallbackInterface { - fn encode(&self, s: &mut S) { +impl<S: Encoder<E>, E> Encodable<S, E> for CallbackInterface { + fn encode(&self, s: &mut S) -> Result<(), E> { unsafe { let tracer: *mut JSTracer = cast::transmute(s); "callback".to_c_str().with_ref(|name| { @@ -40,7 +40,8 @@ impl<S: Encoder> Encodable<S> for CallbackInterface { (*tracer).debugPrintArg = name as *libc::c_void; JS_CallTracer(tracer as *JSTracer, self.callback, JSTRACE_OBJECT as u32); }); - } + }; + Ok(()) } } @@ -98,8 +99,8 @@ pub fn WrapCallThisObject<T: 'static + CallbackContainer + Reflectable>(cx: *JSC } pub struct CallSetup { - cx: *JSContext, - handling: ExceptionHandling + pub cx: *JSContext, + pub handling: ExceptionHandling } impl CallSetup { |