mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Make get() and set() on MutNullableHeap use the correct types.
get() must always return a rooted value, because we have no way of ensuring the value won't be invalidated. set() takes an &T because it's convenient; there isn't any need to expose JS<T>.
This commit is contained in:
parent
7a08b29201
commit
57584e74c6
11 changed files with 68 additions and 67 deletions
|
@ -116,7 +116,7 @@ impl FileReader {
|
|||
|
||||
let global = fr.global.root();
|
||||
let exception = DOMException::new(global.r(), error);
|
||||
fr.error.set(Some(JS::from_rooted(&exception)));
|
||||
fr.error.set(Some(&exception));
|
||||
|
||||
fr.dispatch_progress_event("error".to_owned(), 0, None);
|
||||
return_on_abort!();
|
||||
|
@ -292,7 +292,7 @@ impl FileReaderMethods for FileReader {
|
|||
|
||||
let global = self.global.root();
|
||||
let exception = DOMException::new(global.r(), DOMErrorName::AbortError);
|
||||
self.error.set(Some(JS::from_rooted(&exception)));
|
||||
self.error.set(Some(&exception));
|
||||
|
||||
self.terminate_ongoing_reading();
|
||||
// Steps 5 & 6
|
||||
|
@ -346,7 +346,7 @@ impl FileReader {
|
|||
if blob.IsClosed() {
|
||||
let global = self.global.root();
|
||||
let exception = DOMException::new(global.r(), DOMErrorName::InvalidStateError);
|
||||
self.error.set(Some(JS::from_rooted(&exception)));
|
||||
self.error.set(Some(&exception));
|
||||
|
||||
self.dispatch_progress_event("error".to_owned(), 0, None);
|
||||
return Ok(());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue