mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
refactor: add CanGc as argument to create_buffer_source (#35597)
Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
This commit is contained in:
parent
35f21e426b
commit
245a39c07e
22 changed files with 169 additions and 96 deletions
|
@ -64,11 +64,11 @@ impl TextEncoderMethods<crate::DomTypeHolder> for TextEncoder {
|
|||
}
|
||||
|
||||
/// <https://encoding.spec.whatwg.org/#dom-textencoder-encode>
|
||||
fn Encode(&self, cx: JSContext, input: USVString) -> Uint8Array {
|
||||
fn Encode(&self, cx: JSContext, input: USVString, can_gc: CanGc) -> Uint8Array {
|
||||
let encoded = input.0.as_bytes();
|
||||
|
||||
rooted!(in(*cx) let mut js_object = ptr::null_mut::<JSObject>());
|
||||
create_buffer_source(cx, encoded, js_object.handle_mut())
|
||||
create_buffer_source(cx, encoded, js_object.handle_mut(), can_gc)
|
||||
.expect("Converting input to uint8 array should never fail")
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue