Use specific assertion for DOM attr

This commit is contained in:
CYBAI 2018-01-25 23:48:40 +08:00
parent 968976aba7
commit 34babb6dcf

View file

@ -195,7 +195,7 @@ impl Attr {
ScriptThread::enqueue_callback_reaction(owner, reaction, None);
}
assert!(Some(owner) == self.owner().r());
assert_eq!(Some(owner), self.owner().r());
owner.will_mutate_attr(self);
self.swap_value(&mut value);
if self.identifier.namespace == ns!() {
@ -230,7 +230,7 @@ impl Attr {
// Already gone from the list of attributes of old owner.
assert!(old.get_attribute(&ns, &self.identifier.local_name).r() != Some(self))
}
(Some(old), Some(new)) => assert!(&*old == new),
(Some(old), Some(new)) => assert_eq!(&*old, new),
_ => {},
}
self.owner.set(owner);