mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 18:28:12 +00:00
WebContent: Add $_
variable to browser console
This holds the return value of the expression that was last entered into the browser console. If that last expression returned an error of some kind, `$_` will be `undefined`. This matches the behaviour in Firefox.
This commit is contained in:
parent
3ec13fdb86
commit
c793beb0cc
3 changed files with 15 additions and 1 deletions
|
@ -77,8 +77,10 @@ void WebContentConsoleClient::handle_input(String const& js_source)
|
|||
|
||||
auto result = script->run();
|
||||
|
||||
if (result.value().has_value())
|
||||
if (result.value().has_value()) {
|
||||
m_console_global_object->set_most_recent_result(result.value().value());
|
||||
print_html(JS::MarkupGenerator::html_from_value(*result.value()));
|
||||
}
|
||||
}
|
||||
|
||||
void WebContentConsoleClient::report_exception(JS::Error const& exception, bool in_promise)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue