mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
script creates methods taking '*mut JSContext' unsafe
rebase + marked the necessary new code as unsafe
This commit is contained in:
parent
9fd6f0acd5
commit
b372e7c98f
28 changed files with 274 additions and 226 deletions
|
@ -339,14 +339,12 @@ impl FileReaderMethods for FileReader {
|
|||
|
||||
#[allow(unsafe_code)]
|
||||
// https://w3c.github.io/FileAPI/#dfn-result
|
||||
fn GetResult(&self, _: *mut JSContext) -> Option<StringOrObject> {
|
||||
unsafe fn GetResult(&self, _: *mut JSContext) -> Option<StringOrObject> {
|
||||
self.result.borrow().as_ref().map(|r| match *r {
|
||||
FileReaderResult::String(ref string) =>
|
||||
StringOrObject::String(string.clone()),
|
||||
FileReaderResult::ArrayBuffer(ref arr_buffer) => {
|
||||
unsafe {
|
||||
StringOrObject::Object((*arr_buffer.ptr.get()).to_object())
|
||||
}
|
||||
StringOrObject::Object((*arr_buffer.ptr.get()).to_object())
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue