mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
refactor(consume_body): json stored in roottraceablebox
This commit is contained in:
parent
168f610821
commit
e6de213a13
1 changed files with 3 additions and 2 deletions
|
@ -38,7 +38,7 @@ pub enum BodyType {
|
|||
|
||||
pub enum FetchedData {
|
||||
Text(String),
|
||||
Json(JSValue),
|
||||
Json(RootedTraceableBox<Heap<JSValue>>),
|
||||
BlobData(DomRoot<Blob>),
|
||||
FormData(DomRoot<FormData>),
|
||||
ArrayBuffer(RootedTraceableBox<Heap<*mut JSObject>>),
|
||||
|
@ -137,7 +137,8 @@ fn run_json_data_algorithm(cx: *mut JSContext,
|
|||
// TODO: See issue #13464. Exception should be thrown instead of cleared.
|
||||
return Err(Error::Type("Failed to parse JSON".to_string()));
|
||||
}
|
||||
Ok(FetchedData::Json(rval.get()))
|
||||
let rooted_heap = RootedTraceableBox::from_box(Heap::boxed(rval.get()));
|
||||
Ok(FetchedData::Json(rooted_heap))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue