1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:57:35 +00:00

LibJS+WebContent+js: Bring console.clear() to spec

This is identical to before, since we don't have "group stacks" yet, but
clear() now uses ThrowCompletionOr.
This commit is contained in:
Sam Atkins 2021-12-08 19:24:17 +00:00 committed by Andreas Kling
parent 834ced82d4
commit 9b78e287b0
5 changed files with 9 additions and 7 deletions

View file

@ -76,10 +76,14 @@ ThrowCompletionOr<Value> Console::warn()
return js_undefined();
}
// 1.1.2. clear(), https://console.spec.whatwg.org/#clear
Value Console::clear()
{
// 1. TODO: Empty the appropriate group stack.
// 2. If possible for the environment, clear the console. (Otherwise, do nothing.)
if (m_client)
return m_client->clear();
m_client->clear();
return js_undefined();
}