From 5a611427206e7075934bb077cc931b713adba5b6 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Fri, 29 Jul 2016 10:24:29 +0200 Subject: [PATCH 1/3] Remove an unused argument to ErrorInfo::from_dom_exception. --- components/script/dom/bindings/error.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/script/dom/bindings/error.rs b/components/script/dom/bindings/error.rs index bd63ba84fb1..c4bda97e521 100644 --- a/components/script/dom/bindings/error.rs +++ b/components/script/dom/bindings/error.rs @@ -178,7 +178,7 @@ impl ErrorInfo { }) } - fn from_dom_exception(cx: *mut JSContext, object: HandleObject) -> Option { + fn from_dom_exception(object: HandleObject) -> Option { let exception = match root_from_object::(object.get()) { Ok(exception) => exception, Err(_) => return None, @@ -215,7 +215,7 @@ pub unsafe fn report_pending_exception(cx: *mut JSContext, obj: *mut JSObject) { rooted!(in(cx) let object = value.to_object()); let error_info = ErrorInfo::from_native_error(cx, object.handle()) - .or_else(|| ErrorInfo::from_dom_exception(cx, object.handle())); + .or_else(|| ErrorInfo::from_dom_exception(object.handle())); let error_info = match error_info { Some(error_info) => error_info, None => { From decc57f2ade23156e348e591453bf6c96715680e Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Fri, 29 Jul 2016 10:24:42 +0200 Subject: [PATCH 2/3] Correct the call to JS_SetGCZeal. --- components/script/script_runtime.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/script/script_runtime.rs b/components/script/script_runtime.rs index d07491d8ce8..dfbb5ba5203 100644 --- a/components/script/script_runtime.rs +++ b/components/script/script_runtime.rs @@ -120,7 +120,7 @@ pub unsafe fn new_rt_and_cx() -> Runtime { // Pre barriers aren't working correctly at the moment DisableIncrementalGC(runtime.rt()); - set_gc_zeal_options(runtime.cx()); + set_gc_zeal_options(runtime.rt()); // Enable or disable the JITs. let rt_opts = &mut *RuntimeOptionsRef(runtime.rt()); @@ -400,7 +400,7 @@ unsafe extern fn trace_rust_roots(tr: *mut JSTracer, _data: *mut os::raw::c_void #[allow(unsafe_code)] #[cfg(feature = "debugmozjs")] -unsafe fn set_gc_zeal_options(cx: *mut JSContext) { +unsafe fn set_gc_zeal_options(rt: *mut JSRuntime) { use js::jsapi::{JS_DEFAULT_ZEAL_FREQ, JS_SetGCZeal}; let level = match PREFS.get("js.mem.gc.zeal.level").as_i64() { @@ -411,9 +411,9 @@ unsafe fn set_gc_zeal_options(cx: *mut JSContext) { Some(frequency) if frequency >= 0 => frequency as u32, _ => JS_DEFAULT_ZEAL_FREQ, }; - JS_SetGCZeal(cx, level, frequency); + JS_SetGCZeal(rt, level, frequency); } #[allow(unsafe_code)] #[cfg(not(feature = "debugmozjs"))] -unsafe fn set_gc_zeal_options(_: *mut JSContext) {} +unsafe fn set_gc_zeal_options(_: *mut JSRuntime) {} From 7842b72c096f0971f7319b3e9c3359330ac05521 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Fri, 29 Jul 2016 10:38:10 +0200 Subject: [PATCH 3/3] Remove the no longer necessary iter_arith feature gate. --- components/script/lib.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/components/script/lib.rs b/components/script/lib.rs index 5b16377fe68..20eb3336a38 100644 --- a/components/script/lib.rs +++ b/components/script/lib.rs @@ -10,7 +10,6 @@ #![feature(custom_attribute)] #![feature(custom_derive)] #![feature(fnbox)] -#![feature(iter_arith)] #![feature(mpsc_select)] #![feature(nonzero)] #![feature(on_unimplemented)]