Assert that we successfully got the pending exception

This commit is contained in:
Yusuf Simonson 2018-03-28 10:11:32 +08:00
parent 2d53192666
commit ac1e02405d

View file

@ -138,7 +138,7 @@ fn run_json_data_algorithm(cx: *mut JSContext,
json_text.len() as u32, json_text.len() as u32,
rval.handle_mut()) { rval.handle_mut()) {
rooted!(in(cx) let mut exception = UndefinedValue()); rooted!(in(cx) let mut exception = UndefinedValue());
JS_GetPendingException(cx, exception.handle_mut()); assert!(JS_GetPendingException(cx, exception.handle_mut()));
JS_ClearPendingException(cx); JS_ClearPendingException(cx);
return Ok(FetchedData::JSException(RootedTraceableBox::from_box(Heap::boxed(exception.get())))); return Ok(FetchedData::JSException(RootedTraceableBox::from_box(Heap::boxed(exception.get()))));
} }