mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Format script component
This commit is contained in:
parent
2ca7a13473
commit
c37a345dc9
357 changed files with 25485 additions and 18076 deletions
|
@ -28,9 +28,11 @@ impl TextEncoder {
|
|||
}
|
||||
|
||||
pub fn new(global: &GlobalScope) -> DomRoot<TextEncoder> {
|
||||
reflect_dom_object(Box::new(TextEncoder::new_inherited()),
|
||||
global,
|
||||
TextEncoderBinding::Wrap)
|
||||
reflect_dom_object(
|
||||
Box::new(TextEncoder::new_inherited()),
|
||||
global,
|
||||
TextEncoderBinding::Wrap,
|
||||
)
|
||||
}
|
||||
|
||||
// https://encoding.spec.whatwg.org/#dom-textencoder
|
||||
|
@ -51,7 +53,9 @@ impl TextEncoderMethods for TextEncoder {
|
|||
let encoded = input.0.as_bytes();
|
||||
|
||||
rooted!(in(cx) let mut js_object = ptr::null_mut::<JSObject>());
|
||||
assert!(Uint8Array::create(cx, CreateWith::Slice(&encoded), js_object.handle_mut()).is_ok());
|
||||
assert!(
|
||||
Uint8Array::create(cx, CreateWith::Slice(&encoded), js_object.handle_mut()).is_ok()
|
||||
);
|
||||
|
||||
NonNull::new_unchecked(js_object.get())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue