mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Use explicit reborrows with mozjs::MutableHandle (#35892)
* Explicitly reborrow MutableHandles Signed-off-by: Greg Morenz <greg-morenz@droid.cafe> * Unify jsapi_wrappers Signed-off-by: Greg Morenz <greg-morenz@droid.cafe> * Format mozjs changes Signed-off-by: Greg Morenz <greg-morenz@droid.cafe> * Update mozjs version Signed-off-by: Greg Morenz <greg-morenz@droid.cafe> --------- Signed-off-by: Greg Morenz <greg-morenz@droid.cafe>
This commit is contained in:
parent
40270cb626
commit
4ecf0909e5
14 changed files with 67 additions and 44 deletions
|
@ -27,8 +27,7 @@ use js::jsapi::{
|
|||
ThrowOnModuleEvaluationFailure, Value,
|
||||
};
|
||||
use js::jsval::{JSVal, PrivateValue, UndefinedValue};
|
||||
use js::rust::jsapi_wrapped::JS_GetPendingException;
|
||||
use js::rust::wrappers::JS_SetPendingException;
|
||||
use js::rust::wrappers::{JS_GetPendingException, JS_SetPendingException};
|
||||
use js::rust::{
|
||||
CompileOptionsWrapper, Handle, HandleObject as RustHandleObject, HandleValue, IntoHandle,
|
||||
MutableHandleObject as RustMutableHandleObject, transform_str_to_source_text,
|
||||
|
@ -488,7 +487,7 @@ impl ModuleTree {
|
|||
warn!("fail to compile module script of {}", url);
|
||||
|
||||
rooted!(in(*cx) let mut exception = UndefinedValue());
|
||||
assert!(JS_GetPendingException(*cx, &mut exception.handle_mut()));
|
||||
assert!(JS_GetPendingException(*cx, exception.handle_mut()));
|
||||
JS_ClearPendingException(*cx);
|
||||
|
||||
return Err(RethrowError(RootedTraceableBox::from_box(Heap::boxed(
|
||||
|
@ -531,7 +530,7 @@ impl ModuleTree {
|
|||
warn!("fail to link & instantiate module");
|
||||
|
||||
rooted!(in(*cx) let mut exception = UndefinedValue());
|
||||
assert!(JS_GetPendingException(*cx, &mut exception.handle_mut()));
|
||||
assert!(JS_GetPendingException(*cx, exception.handle_mut()));
|
||||
JS_ClearPendingException(*cx);
|
||||
|
||||
Err(RethrowError(RootedTraceableBox::from_box(Heap::boxed(
|
||||
|
@ -577,7 +576,7 @@ impl ModuleTree {
|
|||
warn!("fail to evaluate module");
|
||||
|
||||
rooted!(in(*cx) let mut exception = UndefinedValue());
|
||||
assert!(JS_GetPendingException(*cx, &mut exception.handle_mut()));
|
||||
assert!(JS_GetPendingException(*cx, exception.handle_mut()));
|
||||
JS_ClearPendingException(*cx);
|
||||
|
||||
Err(RethrowError(RootedTraceableBox::from_box(Heap::boxed(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue