diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2015-10-28 23:35:40 +0530 |
---|---|---|
committer | bors-servo <lbergstrom+bors@mozilla.com> | 2015-10-28 23:35:40 +0530 |
commit | 30ce2a84c162915f71873e9e20955e12709b39ae (patch) | |
tree | 818c8f31d23371fad4f719ec7c416a7932f17110 | |
parent | 0d699a2b4419632e31b35352c518e2ef5ffcc9a3 (diff) | |
parent | 2a2ab23dfb1205cda52fb386ebef140323a36ec3 (diff) | |
download | servo-30ce2a84c162915f71873e9e20955e12709b39ae.tar.gz servo-30ce2a84c162915f71873e9e20955e12709b39ae.zip |
Auto merge of #8242 - Ms2ger:update-js, r=metajack
Update js.
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8242)
<!-- Reviewable:end -->
-rw-r--r-- | components/script/dom/bindings/conversions.rs | 36 | ||||
-rw-r--r-- | components/script/dom/bindings/utils.rs | 2 | ||||
-rw-r--r-- | components/servo/Cargo.lock | 2 | ||||
-rw-r--r-- | ports/cef/Cargo.lock | 2 | ||||
-rw-r--r-- | ports/gonk/Cargo.lock | 2 |
5 files changed, 22 insertions, 22 deletions
diff --git a/components/script/dom/bindings/conversions.rs b/components/script/dom/bindings/conversions.rs index b38f2df0382..710a5715fa4 100644 --- a/components/script/dom/bindings/conversions.rs +++ b/components/script/dom/bindings/conversions.rs @@ -229,10 +229,10 @@ impl ToJSValConvertible for HandleValue { } #[inline] -fn convert_int_from_jsval<T, M>(cx: *mut JSContext, value: HandleValue, - option: ConversionBehavior, - convert_fn: fn(*mut JSContext, HandleValue) -> Result<M, ()>) - -> Result<T, ()> +unsafe fn convert_int_from_jsval<T, M>(cx: *mut JSContext, value: HandleValue, + option: ConversionBehavior, + convert_fn: unsafe fn(*mut JSContext, HandleValue) -> Result<M, ()>) + -> Result<T, ()> where T: Bounded + Zero + As<f64>, M: Zero + As<T>, f64: As<T> @@ -255,7 +255,7 @@ impl ToJSValConvertible for bool { impl FromJSValConvertible for bool { type Config = (); fn from_jsval(_cx: *mut JSContext, val: HandleValue, _option: ()) -> Result<bool, ()> { - Ok(ToBoolean(val)) + Ok(unsafe { ToBoolean(val) }) } } @@ -270,7 +270,7 @@ impl ToJSValConvertible for i8 { impl FromJSValConvertible for i8 { type Config = ConversionBehavior; fn from_jsval(cx: *mut JSContext, val: HandleValue, option: ConversionBehavior) -> Result<i8, ()> { - convert_int_from_jsval(cx, val, option, ToInt32) + unsafe { convert_int_from_jsval(cx, val, option, ToInt32) } } } @@ -285,7 +285,7 @@ impl ToJSValConvertible for u8 { impl FromJSValConvertible for u8 { type Config = ConversionBehavior; fn from_jsval(cx: *mut JSContext, val: HandleValue, option: ConversionBehavior) -> Result<u8, ()> { - convert_int_from_jsval(cx, val, option, ToInt32) + unsafe { convert_int_from_jsval(cx, val, option, ToInt32) } } } @@ -300,7 +300,7 @@ impl ToJSValConvertible for i16 { impl FromJSValConvertible for i16 { type Config = ConversionBehavior; fn from_jsval(cx: *mut JSContext, val: HandleValue, option: ConversionBehavior) -> Result<i16, ()> { - convert_int_from_jsval(cx, val, option, ToInt32) + unsafe { convert_int_from_jsval(cx, val, option, ToInt32) } } } @@ -315,7 +315,7 @@ impl ToJSValConvertible for u16 { impl FromJSValConvertible for u16 { type Config = ConversionBehavior; fn from_jsval(cx: *mut JSContext, val: HandleValue, option: ConversionBehavior) -> Result<u16, ()> { - convert_int_from_jsval(cx, val, option, ToUint16) + unsafe { convert_int_from_jsval(cx, val, option, ToUint16) } } } @@ -330,7 +330,7 @@ impl ToJSValConvertible for i32 { impl FromJSValConvertible for i32 { type Config = ConversionBehavior; fn from_jsval(cx: *mut JSContext, val: HandleValue, option: ConversionBehavior) -> Result<i32, ()> { - convert_int_from_jsval(cx, val, option, ToInt32) + unsafe { convert_int_from_jsval(cx, val, option, ToInt32) } } } @@ -345,7 +345,7 @@ impl ToJSValConvertible for u32 { impl FromJSValConvertible for u32 { type Config = ConversionBehavior; fn from_jsval(cx: *mut JSContext, val: HandleValue, option: ConversionBehavior) -> Result<u32, ()> { - convert_int_from_jsval(cx, val, option, ToUint32) + unsafe { convert_int_from_jsval(cx, val, option, ToUint32) } } } @@ -362,7 +362,7 @@ impl ToJSValConvertible for i64 { impl FromJSValConvertible for i64 { type Config = ConversionBehavior; fn from_jsval(cx: *mut JSContext, val: HandleValue, option: ConversionBehavior) -> Result<i64, ()> { - convert_int_from_jsval(cx, val, option, ToInt64) + unsafe { convert_int_from_jsval(cx, val, option, ToInt64) } } } @@ -379,7 +379,7 @@ impl ToJSValConvertible for u64 { impl FromJSValConvertible for u64 { type Config = ConversionBehavior; fn from_jsval(cx: *mut JSContext, val: HandleValue, option: ConversionBehavior) -> Result<u64, ()> { - convert_int_from_jsval(cx, val, option, ToUint64) + unsafe { convert_int_from_jsval(cx, val, option, ToUint64) } } } @@ -396,7 +396,7 @@ impl ToJSValConvertible for f32 { impl FromJSValConvertible for f32 { type Config = (); fn from_jsval(cx: *mut JSContext, val: HandleValue, _option: ()) -> Result<f32, ()> { - let result = ToNumber(cx, val); + let result = unsafe { ToNumber(cx, val) }; result.map(|f| f as f32) } } @@ -414,7 +414,7 @@ impl ToJSValConvertible for f64 { impl FromJSValConvertible for f64 { type Config = (); fn from_jsval(cx: *mut JSContext, val: HandleValue, _option: ()) -> Result<f64, ()> { - ToNumber(cx, val) + unsafe { ToNumber(cx, val) } } } @@ -544,7 +544,7 @@ impl FromJSValConvertible for DOMString { value.get().is_null() { Ok("".to_owned()) } else { - let jsstr = ToString(cx, value); + let jsstr = unsafe { ToString(cx, value) }; if jsstr.is_null() { debug!("ToString failed"); Err(()) @@ -567,7 +567,7 @@ impl FromJSValConvertible for USVString { type Config = (); fn from_jsval(cx: *mut JSContext, value: HandleValue, _: ()) -> Result<USVString, ()> { - let jsstr = ToString(cx, value); + let jsstr = unsafe { ToString(cx, value) }; if jsstr.is_null() { debug!("ToString failed"); return Err(()); @@ -604,7 +604,7 @@ impl ToJSValConvertible for ByteString { impl FromJSValConvertible for ByteString { type Config = (); fn from_jsval(cx: *mut JSContext, value: HandleValue, _option: ()) -> Result<ByteString, ()> { - let string = ToString(cx, value); + let string = unsafe { ToString(cx, value) }; if string.is_null() { debug!("ToString failed"); return Err(()); diff --git a/components/script/dom/bindings/utils.rs b/components/script/dom/bindings/utils.rs index 45a06674cfc..6fae276271c 100644 --- a/components/script/dom/bindings/utils.rs +++ b/components/script/dom/bindings/utils.rs @@ -520,7 +520,7 @@ pub fn find_enum_string_index(cx: *mut JSContext, v: HandleValue, values: &[&'static str]) -> Result<Option<usize>, ()> { - let jsstr = ToString(cx, v); + let jsstr = unsafe { ToString(cx, v) }; if jsstr.is_null() { return Err(()); } diff --git a/components/servo/Cargo.lock b/components/servo/Cargo.lock index 7d26d740f63..a741c5ec99b 100644 --- a/components/servo/Cargo.lock +++ b/components/servo/Cargo.lock @@ -964,7 +964,7 @@ dependencies = [ [[package]] name = "js" version = "0.1.0" -source = "git+https://github.com/servo/rust-mozjs#cb290c48a75852fb26ed67b3ef3e2508c1560b1a" +source = "git+https://github.com/servo/rust-mozjs#8fabaf877224fdd7a33286c5de2a99189aae5524" dependencies = [ "heapsize 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/ports/cef/Cargo.lock b/ports/cef/Cargo.lock index 123a6d8994b..6740a3a71b6 100644 --- a/ports/cef/Cargo.lock +++ b/ports/cef/Cargo.lock @@ -914,7 +914,7 @@ dependencies = [ [[package]] name = "js" version = "0.1.0" -source = "git+https://github.com/servo/rust-mozjs#cb290c48a75852fb26ed67b3ef3e2508c1560b1a" +source = "git+https://github.com/servo/rust-mozjs#8fabaf877224fdd7a33286c5de2a99189aae5524" dependencies = [ "heapsize 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/ports/gonk/Cargo.lock b/ports/gonk/Cargo.lock index b5847d95b1f..2a6678b96b4 100644 --- a/ports/gonk/Cargo.lock +++ b/ports/gonk/Cargo.lock @@ -863,7 +863,7 @@ dependencies = [ [[package]] name = "js" version = "0.1.0" -source = "git+https://github.com/servo/rust-mozjs#cb290c48a75852fb26ed67b3ef3e2508c1560b1a" +source = "git+https://github.com/servo/rust-mozjs#8fabaf877224fdd7a33286c5de2a99189aae5524" dependencies = [ "heapsize 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", |