mirror of
https://github.com/servo/servo.git
synced 2025-07-24 07:40:27 +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 {
|
pub enum FetchedData {
|
||||||
Text(String),
|
Text(String),
|
||||||
Json(JSValue),
|
Json(RootedTraceableBox<Heap<JSValue>>),
|
||||||
BlobData(DomRoot<Blob>),
|
BlobData(DomRoot<Blob>),
|
||||||
FormData(DomRoot<FormData>),
|
FormData(DomRoot<FormData>),
|
||||||
ArrayBuffer(RootedTraceableBox<Heap<*mut JSObject>>),
|
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.
|
// TODO: See issue #13464. Exception should be thrown instead of cleared.
|
||||||
return Err(Error::Type("Failed to parse JSON".to_string()));
|
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