aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/dom/bindings/error.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/script/dom/bindings/error.rs')
-rw-r--r--src/components/script/dom/bindings/error.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/components/script/dom/bindings/error.rs b/src/components/script/dom/bindings/error.rs
index 8793a1c1c6e..f47f28c95b6 100644
--- a/src/components/script/dom/bindings/error.rs
+++ b/src/components/script/dom/bindings/error.rs
@@ -4,7 +4,7 @@
use js::jsapi::{JSContext, JSBool};
use js::jsapi::{JS_IsExceptionPending};
-use js::jsapi::{JS_ReportErrorNumber, JSErrorFormatString, struct_JSErrorFormatString, JSEXN_TYPEERR};
+use js::jsapi::{JS_ReportErrorNumber, JSErrorFormatString, JSEXN_TYPEERR};
use js::glue::{ReportError};
use libc;
@@ -29,7 +29,7 @@ pub type Fallible<T> = Result<T, Error>;
pub type ErrorResult = Fallible<()>;
-pub fn throw_method_failed_with_details<T>(cx: *JSContext,
+pub fn throw_method_failed_with_details<T>(cx: *mut JSContext,
result: Result<T, Error>,
interface: &'static str,
member: &'static str) -> JSBool {
@@ -42,7 +42,7 @@ pub fn throw_method_failed_with_details<T>(cx: *JSContext,
return 0;
}
-pub fn throw_not_in_union(cx: *JSContext, names: &'static str) -> JSBool {
+pub fn throw_not_in_union(cx: *mut JSContext, names: &'static str) -> JSBool {
assert!(unsafe { JS_IsExceptionPending(cx) } == 0);
let message = format!("argument could not be converted to any of: {}", names);
message.with_c_str(|string| {
@@ -58,7 +58,7 @@ static ERROR_FORMAT_STRING_STRING: [libc::c_char, ..4] = [
0 as libc::c_char,
];
-static ERROR_FORMAT_STRING: JSErrorFormatString = struct_JSErrorFormatString {
+static ERROR_FORMAT_STRING: JSErrorFormatString = JSErrorFormatString {
format: &ERROR_FORMAT_STRING_STRING as *libc::c_char,
argCount: 1,
exnType: JSEXN_TYPEERR as i16,
@@ -72,9 +72,9 @@ extern fn get_error_message(_user_ref: *mut libc::c_void,
&ERROR_FORMAT_STRING as *JSErrorFormatString
}
-pub fn throw_type_error(cx: *JSContext, error: &str) {
+pub fn throw_type_error(cx: *mut JSContext, error: &str) {
let error = error.to_c_str();
error.with_ref(|error| unsafe {
- JS_ReportErrorNumber(cx, get_error_message, ptr::null(), 0, error);
+ JS_ReportErrorNumber(cx, Some(get_error_message), ptr::mut_null(), 0, error);
});
}