aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/interface.rs
diff options
context:
space:
mode:
authorCYBAI <cyb.ai.815@gmail.com>2018-01-25 23:49:01 +0800
committerCYBAI <cyb.ai.815@gmail.com>2018-01-26 01:18:55 +0800
commit1c31370a0853af93e6572e9f8e177e2e5c2f2d07 (patch)
tree81851c29ad8ff8379b21dfc0426150b3e01713d8 /components/script/dom/bindings/interface.rs
parent34babb6dcf1ef9c3f9e12c96ca420a83c318daaf (diff)
downloadservo-1c31370a0853af93e6572e9f8e177e2e5c2f2d07.tar.gz
servo-1c31370a0853af93e6572e9f8e177e2e5c2f2d07.zip
Use specific assertion for DOM binding interface
Diffstat (limited to 'components/script/dom/bindings/interface.rs')
-rw-r--r--components/script/dom/bindings/interface.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/components/script/dom/bindings/interface.rs b/components/script/dom/bindings/interface.rs
index 5fc0c8a0590..47f5ffb8574 100644
--- a/components/script/dom/bindings/interface.rs
+++ b/components/script/dom/bindings/interface.rs
@@ -234,7 +234,7 @@ pub unsafe fn create_named_constructors(
rooted!(in(cx) let mut constructor = ptr::null_mut::<JSObject>());
for &(native, name, arity) in named_constructors {
- assert!(*name.last().unwrap() == b'\0');
+ assert_eq!(*name.last().unwrap(), b'\0');
let fun = JS_NewFunction(cx,
Some(native),
@@ -324,7 +324,7 @@ pub unsafe fn define_on_global_object(
global: HandleObject,
name: &[u8],
obj: HandleObject) {
- assert!(*name.last().unwrap() == b'\0');
+ assert_eq!(*name.last().unwrap(), b'\0');
assert!(JS_DefineProperty1(cx,
global,
name.as_ptr() as *const libc::c_char,
@@ -429,7 +429,7 @@ unsafe fn create_unscopable_object(
rval.set(JS_NewPlainObject(cx));
assert!(!rval.ptr.is_null());
for &name in names {
- assert!(*name.last().unwrap() == b'\0');
+ assert_eq!(*name.last().unwrap(), b'\0');
assert!(JS_DefineProperty(
cx, rval.handle(), name.as_ptr() as *const libc::c_char, TrueHandleValue,
JSPROP_READONLY, None, None));
@@ -437,7 +437,7 @@ unsafe fn create_unscopable_object(
}
unsafe fn define_name(cx: *mut JSContext, obj: HandleObject, name: &[u8]) {
- assert!(*name.last().unwrap() == b'\0');
+ assert_eq!(*name.last().unwrap(), b'\0');
rooted!(in(cx) let name = JS_AtomizeAndPinString(cx, name.as_ptr() as *const libc::c_char));
assert!(!name.is_null());
assert!(JS_DefineProperty2(cx,