mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +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
|
@ -78,14 +78,14 @@ impl TextDecoderMethods for TextDecoder {
|
|||
|
||||
#[allow(unsafe_code)]
|
||||
// https://encoding.spec.whatwg.org/#dom-textdecoder-decode
|
||||
fn Decode(&self, _cx: *mut JSContext, input: Option<*mut JSObject>)
|
||||
unsafe fn Decode(&self, _cx: *mut JSContext, input: Option<*mut JSObject>)
|
||||
-> Fallible<USVString> {
|
||||
let input = match input {
|
||||
Some(input) => input,
|
||||
None => return Ok(USVString("".to_owned())),
|
||||
};
|
||||
|
||||
let data = match unsafe { array_buffer_view_data::<u8>(input) } {
|
||||
let data = match array_buffer_view_data::<u8>(input) {
|
||||
Some(data) => data,
|
||||
None => {
|
||||
return Err(Error::Type("Argument to TextDecoder.decode is not an ArrayBufferView".to_owned()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue