diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2021-12-08 19:43:29 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-12-27 21:44:07 +0100 |
commit | ce694490f310b6da886ef086ba9c32c407528883 (patch) | |
tree | 2a07dd369d68d1a7d490655dce17efd2244e27e2 /Userland/Utilities/js.cpp | |
parent | 9b78e287b093bde65024f24415a0a36d0c4993c1 (diff) | |
download | serenity-ce694490f310b6da886ef086ba9c32c407528883.zip |
LibJS+WebContent+js: Bring console.assert() to spec
Diffstat (limited to 'Userland/Utilities/js.cpp')
-rw-r--r-- | Userland/Utilities/js.cpp | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/Userland/Utilities/js.cpp b/Userland/Utilities/js.cpp index 187e463847..3c7ea906db 100644 --- a/Userland/Utilities/js.cpp +++ b/Userland/Utilities/js.cpp @@ -1140,20 +1140,6 @@ public: return JS::js_undefined(); } - virtual JS::Value assert_() override - { - auto& vm = this->vm(); - if (!vm.argument(0).to_boolean()) { - if (vm.argument_count() > 1) { - js_out("\033[31;1mAssertion failed:\033[0m"); - js_outln(" {}", vm.join_arguments(1)); - } else { - js_outln("\033[31;1mAssertion failed\033[0m"); - } - } - return JS::js_undefined(); - } - virtual JS::ThrowCompletionOr<JS::Value> printer(JS::Console::LogLevel log_level, Vector<JS::Value>& arguments) override { auto output = String::join(" ", arguments); @@ -1164,6 +1150,7 @@ public: js_outln("\033[36;1m{}\033[0m", output); break; case JS::Console::LogLevel::Error: + case JS::Console::LogLevel::Assert: js_outln("\033[31;1m{}\033[0m", output); break; case JS::Console::LogLevel::Info: |