Fix formatting.

This commit is contained in:
Josh Matthews 2023-02-16 23:33:24 -05:00
parent 5e5669b945
commit 9ea1399c30
4 changed files with 7 additions and 15 deletions

View file

@ -719,8 +719,7 @@ impl Callback for ConsumeBodyPromiseHandler {
#[allow(unrooted_must_root)]
pub fn consume_body<T: BodyMixin + DomObject>(object: &T, body_type: BodyType) -> Rc<Promise> {
let in_realm_proof = AlreadyInRealm::assert();
let promise =
Promise::new_in_current_realm(InRealm::Already(&in_realm_proof));
let promise = Promise::new_in_current_realm(InRealm::Already(&in_realm_proof));
// Step 1
if object.is_disturbed() || object.is_locked() {

View file

@ -17,7 +17,8 @@ impl Console {
#[allow(unsafe_code)]
fn send_to_devtools(global: &GlobalScope, level: LogLevel, message: DOMString) {
if let Some(chan) = global.devtools_chan() {
let caller = unsafe { describe_scripted_caller(*GlobalScope::get_cx()) }.unwrap_or_default();
let caller =
unsafe { describe_scripted_caller(*GlobalScope::get_cx()) }.unwrap_or_default();
let console_message = ConsoleMessage {
message: String::from(message),
logLevel: level,

View file

@ -3574,8 +3574,7 @@ impl Document {
pub fn enter_fullscreen(&self, pending: &Element) -> Rc<Promise> {
// Step 1
let in_realm_proof = AlreadyInRealm::assert();
let promise =
Promise::new_in_current_realm(InRealm::Already(&in_realm_proof));
let promise = Promise::new_in_current_realm(InRealm::Already(&in_realm_proof));
let mut error = false;
// Step 4

View file

@ -424,8 +424,7 @@ impl ModuleTree {
let cx = GlobalScope::get_cx();
let _ac = JSAutoRealm::new(*cx, *global.reflector().get_jsobject());
let compile_options =
unsafe { CompileOptionsWrapper::new(*cx, url.as_str(), 1) };
let compile_options = unsafe { CompileOptionsWrapper::new(*cx, url.as_str(), 1) };
unsafe {
rooted!(in(*cx) let mut module_script = CompileModule1(
@ -438,10 +437,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, &mut exception.handle_mut()));
JS_ClearPendingException(*cx);
return Err(RethrowError(RootedTraceableBox::from_box(Heap::boxed(
@ -483,10 +479,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, &mut exception.handle_mut()));
JS_ClearPendingException(*cx);
Err(RethrowError(RootedTraceableBox::from_box(Heap::boxed(