mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
DOMRefCell<T>.is_mutably_borrowed() should return the state correctly.
This method returned the result of `RefCell<T>.try_borrow().is_some()`. But it meant whether the state **is not** BorrowState::Writing. This wrong is introduced by [1], Before it revision, this method had returned whether the state is BorrowState::Writing or not. This doesn't change callers of this method because git blames ([3], [4]) says that the caller is introduced by [2] and [2] is introduced before [1]. [1]:86d609abaf
[2]:49234484d6
[3]: https://github.com/servo/servo/blame/2cc08f289ab909de44fa09a07b2c43b70ce379b9/components/script/dom/servohtmlparser.rs [4]: https://github.com/servo/servo/blame/a7e29939a1df679bd865573dc71f7ba65f0268c4/components/script/dom/bindings/cell.rs
This commit is contained in:
parent
552a418a33
commit
dbb0f49bc7
1 changed files with 1 additions and 1 deletions
|
@ -52,7 +52,7 @@ impl<T> DOMRefCell<T> {
|
|||
///
|
||||
/// For safety checks in debug builds only.
|
||||
pub fn is_mutably_borrowed(&self) -> bool {
|
||||
self.value.try_borrow().is_some()
|
||||
self.value.borrow_state() == BorrowState::Writing
|
||||
}
|
||||
|
||||
/// Attempts to immutably borrow the wrapped value.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue