mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Fix formatting.
This commit is contained in:
parent
5e5669b945
commit
9ea1399c30
4 changed files with 7 additions and 15 deletions
|
@ -719,8 +719,7 @@ impl Callback for ConsumeBodyPromiseHandler {
|
||||||
#[allow(unrooted_must_root)]
|
#[allow(unrooted_must_root)]
|
||||||
pub fn consume_body<T: BodyMixin + DomObject>(object: &T, body_type: BodyType) -> Rc<Promise> {
|
pub fn consume_body<T: BodyMixin + DomObject>(object: &T, body_type: BodyType) -> Rc<Promise> {
|
||||||
let in_realm_proof = AlreadyInRealm::assert();
|
let in_realm_proof = AlreadyInRealm::assert();
|
||||||
let promise =
|
let promise = Promise::new_in_current_realm(InRealm::Already(&in_realm_proof));
|
||||||
Promise::new_in_current_realm(InRealm::Already(&in_realm_proof));
|
|
||||||
|
|
||||||
// Step 1
|
// Step 1
|
||||||
if object.is_disturbed() || object.is_locked() {
|
if object.is_disturbed() || object.is_locked() {
|
||||||
|
|
|
@ -17,7 +17,8 @@ impl Console {
|
||||||
#[allow(unsafe_code)]
|
#[allow(unsafe_code)]
|
||||||
fn send_to_devtools(global: &GlobalScope, level: LogLevel, message: DOMString) {
|
fn send_to_devtools(global: &GlobalScope, level: LogLevel, message: DOMString) {
|
||||||
if let Some(chan) = global.devtools_chan() {
|
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 {
|
let console_message = ConsoleMessage {
|
||||||
message: String::from(message),
|
message: String::from(message),
|
||||||
logLevel: level,
|
logLevel: level,
|
||||||
|
|
|
@ -3574,8 +3574,7 @@ impl Document {
|
||||||
pub fn enter_fullscreen(&self, pending: &Element) -> Rc<Promise> {
|
pub fn enter_fullscreen(&self, pending: &Element) -> Rc<Promise> {
|
||||||
// Step 1
|
// Step 1
|
||||||
let in_realm_proof = AlreadyInRealm::assert();
|
let in_realm_proof = AlreadyInRealm::assert();
|
||||||
let promise =
|
let promise = Promise::new_in_current_realm(InRealm::Already(&in_realm_proof));
|
||||||
Promise::new_in_current_realm(InRealm::Already(&in_realm_proof));
|
|
||||||
let mut error = false;
|
let mut error = false;
|
||||||
|
|
||||||
// Step 4
|
// Step 4
|
||||||
|
|
|
@ -424,8 +424,7 @@ impl ModuleTree {
|
||||||
let cx = GlobalScope::get_cx();
|
let cx = GlobalScope::get_cx();
|
||||||
let _ac = JSAutoRealm::new(*cx, *global.reflector().get_jsobject());
|
let _ac = JSAutoRealm::new(*cx, *global.reflector().get_jsobject());
|
||||||
|
|
||||||
let compile_options =
|
let compile_options = unsafe { CompileOptionsWrapper::new(*cx, url.as_str(), 1) };
|
||||||
unsafe { CompileOptionsWrapper::new(*cx, url.as_str(), 1) };
|
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
rooted!(in(*cx) let mut module_script = CompileModule1(
|
rooted!(in(*cx) let mut module_script = CompileModule1(
|
||||||
|
@ -438,10 +437,7 @@ impl ModuleTree {
|
||||||
warn!("fail to compile module script of {}", url);
|
warn!("fail to compile module script of {}", url);
|
||||||
|
|
||||||
rooted!(in(*cx) let mut exception = UndefinedValue());
|
rooted!(in(*cx) let mut exception = UndefinedValue());
|
||||||
assert!(JS_GetPendingException(
|
assert!(JS_GetPendingException(*cx, &mut exception.handle_mut()));
|
||||||
*cx,
|
|
||||||
&mut exception.handle_mut()
|
|
||||||
));
|
|
||||||
JS_ClearPendingException(*cx);
|
JS_ClearPendingException(*cx);
|
||||||
|
|
||||||
return Err(RethrowError(RootedTraceableBox::from_box(Heap::boxed(
|
return Err(RethrowError(RootedTraceableBox::from_box(Heap::boxed(
|
||||||
|
@ -483,10 +479,7 @@ impl ModuleTree {
|
||||||
warn!("fail to link & instantiate module");
|
warn!("fail to link & instantiate module");
|
||||||
|
|
||||||
rooted!(in(*cx) let mut exception = UndefinedValue());
|
rooted!(in(*cx) let mut exception = UndefinedValue());
|
||||||
assert!(JS_GetPendingException(
|
assert!(JS_GetPendingException(*cx, &mut exception.handle_mut()));
|
||||||
*cx,
|
|
||||||
&mut exception.handle_mut()
|
|
||||||
));
|
|
||||||
JS_ClearPendingException(*cx);
|
JS_ClearPendingException(*cx);
|
||||||
|
|
||||||
Err(RethrowError(RootedTraceableBox::from_box(Heap::boxed(
|
Err(RethrowError(RootedTraceableBox::from_box(Heap::boxed(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue