Browse Source

add group_collapsed function executing group inside it (#3867)

pull/3868/head
leoflalv 6 months ago committed by GitHub
parent
commit
fd1a348601
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 21
      core/runtime/src/console/mod.rs

21
core/runtime/src/console/mod.rs

@ -218,7 +218,7 @@ impl Console {
0, 0,
) )
.function( .function(
console_method_mut(Self::group, state.clone()), console_method_mut(Self::group_collapsed, state.clone()),
js_string!("groupCollapsed"), js_string!("groupCollapsed"),
0, 0,
) )
@ -658,6 +658,25 @@ impl Console {
Ok(JsValue::undefined()) Ok(JsValue::undefined())
} }
/// `console.groupCollapsed(...data)`
///
/// Adds new group collapsed with name from formatted data to stack.
///
/// More information:
/// - [MDN documentation][mdn]
/// - [WHATWG `console` specification][spec]
///
/// [spec]: https://console.spec.whatwg.org/#groupcollapsed
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/API/console/groupcollapsed_static
fn group_collapsed(
_: &JsValue,
args: &[JsValue],
console: &mut Self,
context: &mut Context,
) -> JsResult<JsValue> {
Console::group(&JsValue::Undefined, args, console, context)
}
/// `console.groupEnd(label)` /// `console.groupEnd(label)`
/// ///
/// Removes the last group from the stack. /// Removes the last group from the stack.

Loading…
Cancel
Save