Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions core/runtime/src/console/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,11 @@ impl Console {
js_string!("error"),
0,
)
.function(
console_method(Self::error, state.clone(), logger.clone()),
js_string!("exception"),
0,
)
.function(
console_method(Self::info, state.clone(), logger.clone()),
js_string!("info"),
Expand Down
20 changes: 20 additions & 0 deletions core/runtime/src/console/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -841,6 +841,26 @@ fn console_table_map_ignores_properties_filter() {
assert!(logs.contains("Values"));
}

/// exception should be an alias for error.
#[test]
fn console_exception_is_alias_for_error() {
let mut context = Context::default();
let logger = RecordingLogger::default();
Console::register_with_logger(logger.clone(), &mut context).unwrap();

run_test_actions_with(
[
TestAction::run(indoc! {r#"
console.exception("hello world");
"#}),
],
&mut context,
);

let logs = logger.log.borrow().clone();
assert_eq!(logs, "hello world\n");
}

/// Set should ignore the properties filter and keep its fixed column layout.
#[test]
fn console_table_set_ignores_properties_filter() {
Expand Down