mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Rust upgrade to rustc hash b03a2755193cd756583bcf5831cf4545d75ecb8a
This commit is contained in:
parent
26045d7fcb
commit
d1b433a3b3
160 changed files with 1427 additions and 1162 deletions
|
@ -2,7 +2,7 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#![deny(missing_doc)]
|
||||
#![deny(missing_docs)]
|
||||
|
||||
//! Conversions of Rust values to and from `JSVal`.
|
||||
|
||||
|
@ -69,7 +69,7 @@ impl ToJSValConvertible for JSVal {
|
|||
fn to_jsval(&self, cx: *mut JSContext) -> JSVal {
|
||||
let mut value = *self;
|
||||
if unsafe { JS_WrapValue(cx, &mut value) } == 0 {
|
||||
fail!("JS_WrapValue failed.");
|
||||
panic!("JS_WrapValue failed.");
|
||||
}
|
||||
value
|
||||
}
|
||||
|
@ -238,7 +238,7 @@ impl ToJSValConvertible for DOMString {
|
|||
let string_utf16: Vec<u16> = self.as_slice().utf16_units().collect();
|
||||
let jsstr = JS_NewUCStringCopyN(cx, string_utf16.as_ptr(), string_utf16.len() as libc::size_t);
|
||||
if jsstr.is_null() {
|
||||
fail!("JS_NewUCStringCopyN failed");
|
||||
panic!("JS_NewUCStringCopyN failed");
|
||||
}
|
||||
StringValue(&*jsstr)
|
||||
}
|
||||
|
@ -304,7 +304,7 @@ impl ToJSValConvertible for ByteString {
|
|||
let jsstr = JS_NewStringCopyN(cx, slice.as_ptr() as *const libc::c_char,
|
||||
slice.len() as libc::size_t);
|
||||
if jsstr.is_null() {
|
||||
fail!("JS_NewStringCopyN failed");
|
||||
panic!("JS_NewStringCopyN failed");
|
||||
}
|
||||
StringValue(&*jsstr)
|
||||
}
|
||||
|
@ -340,7 +340,7 @@ impl ToJSValConvertible for Reflector {
|
|||
assert!(obj.is_not_null());
|
||||
let mut value = ObjectValue(unsafe { &*obj });
|
||||
if unsafe { JS_WrapValue(cx, &mut value) } == 0 {
|
||||
fail!("JS_WrapValue failed.");
|
||||
panic!("JS_WrapValue failed.");
|
||||
}
|
||||
value
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue