Skip to content

Commit

Permalink
Temporarily remove Response.bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
Arshia001 committed Jun 11, 2024
1 parent 1d5306f commit ee79bb8
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions runtime/src/globals/fetch/response/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,15 +361,18 @@ impl Response {
}
}

pub fn bytes(&mut self, cx: &Context) -> Option<Promise> {
let this = TracedHeap::new(self.reflector().get());
unsafe {
future_to_promise::<_, _, _, Error>(cx, move |cx| async move {
let bytes = Self::take_body_bytes(&this, cx).await?;
Ok(Uint8ArrayWrapper::from(Vec::from(bytes)))
})
}
}
// TODO: the inclusion of this method causes problems with requests
// not finishing (undefined behavior?), commented out for 1.2.0 release

// pub fn bytes(&mut self, cx: &Context) -> Option<Promise> {
// let this = TracedHeap::new(self.reflector().get());
// unsafe {
// future_to_promise::<_, _, _, Error>(cx, move |cx| async move {
// let bytes = Self::take_body_bytes(&this, cx).await?;
// Ok(Uint8ArrayWrapper::from(Vec::from(bytes)))
// })
// }
// }

pub fn blob(&mut self, cx: &Context) -> Option<Promise> {
let this = TracedHeap::new(self.reflector.get());
Expand Down

0 comments on commit ee79bb8

Please sign in to comment.