Skip to content

Truly independent web browser

Utilities/js: Add debugger command aliases

Sam Atkins44bfcd4f64ba
diff --git a/Libraries/LibJS/Rust/src/utilities/js.rs b/Libraries/LibJS/Rust/src/utilities/js.rs
index 31e261727a8..fc36a7749a6 100644
--- a/Libraries/LibJS/Rust/src/utilities/js.rs
+++ b/Libraries/LibJS/Rust/src/utilities/js.rs
@@ -726,9 +726,9 @@ fn print_breakpoint(debugger: &Debugger, breakpoint: &Breakpoint) {
fn print_debugger_help() {
standard_output::outln(b"Debugger commands:");
- standard_output::outln(b" break [file:]<line>[:column]");
+ standard_output::outln(b" break (b) [file:]<line>[:column]");
standard_output::outln(b" breakpoints");
- standard_output::outln(b" continue");
+ standard_output::outln(b" continue (c)");
standard_output::outln(b" delete <id>");
standard_output::outln(b" help");
}
@@ -816,7 +816,7 @@ fn run_debugger_prompt(vm: &Vm, pause_info: &PauseInfo, line_editor: Option<&JSL
let command_name = command.consume_command_name();
command.skip_whitespace();
- if command_name == b"continue" && command.is_eof() {
+ if (command_name == b"continue" || command_name == b"c") && command.is_eof() {
debugger.continue_execution(ResumeMode::Continue);
return;
}
@@ -839,7 +839,7 @@ fn run_debugger_prompt(vm: &Vm, pause_info: &PauseInfo, line_editor: Option<&JSL
continue;
}
- if command_name == b"break" {
+ if command_name == b"break" || command_name == b"b" {
let current_filename = pause_info
.source_range
.as_ref()
diff --git a/Tests/LibJS/Debugger/expected/basic.txt b/Tests/LibJS/Debugger/expected/basic.txt
index 3a86586639e..f8bb4114793 100644
--- a/Tests/LibJS/Debugger/expected/basic.txt
+++ b/Tests/LibJS/Debugger/expected/basic.txt
@@ -1,8 +1,8 @@
Paused at <ladybird>/Tests/LibJS/Debugger/input/basic.js:7:1 (entry)
Debugger commands:
- break [file:]<line>[:column]
+ break (b) [file:]<line>[:column]
breakpoints
- continue
+ continue (c)
delete <id>
help
No breakpoints.
diff --git a/Tests/LibJS/Debugger/input/basic.commands b/Tests/LibJS/Debugger/input/basic.commands
index a9d2ce5aa3b..04c6e18f251 100644
--- a/Tests/LibJS/Debugger/input/basic.commands
+++ b/Tests/LibJS/Debugger/input/basic.commands
@@ -3,7 +3,7 @@ breakpoints
break 4
breakpoints
delete 1
-break 4
-continue
+b 4
+c
delete 2
continue