2020-03-16 13:58:20 +00:00
|
|
|
/*
|
2024-10-04 11:19:50 +00:00
|
|
|
* Copyright (c) 2020, Andreas Kling <andreas@ladybird.org>
|
2020-03-16 13:58:20 +00:00
|
|
|
*
|
2021-04-22 08:24:48 +00:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-03-16 13:58:20 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <LibJS/Runtime/Object.h>
|
|
|
|
|
|
|
|
namespace JS {
|
|
|
|
|
|
|
|
class ConsoleObject final : public Object {
|
2020-06-21 13:14:02 +00:00
|
|
|
JS_OBJECT(ConsoleObject, Object);
|
2024-11-14 15:01:23 +00:00
|
|
|
GC_DECLARE_ALLOCATOR(ConsoleObject);
|
2020-06-21 13:14:02 +00:00
|
|
|
|
2020-03-16 13:58:20 +00:00
|
|
|
public:
|
2023-08-07 06:41:28 +00:00
|
|
|
virtual void initialize(Realm&) override;
|
2024-04-20 19:19:51 +00:00
|
|
|
virtual ~ConsoleObject() override;
|
2020-03-16 13:58:20 +00:00
|
|
|
|
2022-08-28 13:20:06 +00:00
|
|
|
Console& console() { return *m_console; }
|
|
|
|
|
2020-03-16 13:58:20 +00:00
|
|
|
private:
|
2022-08-28 21:51:28 +00:00
|
|
|
explicit ConsoleObject(Realm&);
|
2024-04-20 19:19:51 +00:00
|
|
|
virtual void visit_edges(Visitor&) override;
|
2022-08-28 21:51:28 +00:00
|
|
|
|
2023-06-22 01:27:14 +00:00
|
|
|
JS_DECLARE_NATIVE_FUNCTION(assert_);
|
|
|
|
JS_DECLARE_NATIVE_FUNCTION(clear);
|
2021-10-28 21:28:04 +00:00
|
|
|
JS_DECLARE_NATIVE_FUNCTION(debug);
|
|
|
|
JS_DECLARE_NATIVE_FUNCTION(error);
|
2023-06-22 01:27:14 +00:00
|
|
|
JS_DECLARE_NATIVE_FUNCTION(info);
|
|
|
|
JS_DECLARE_NATIVE_FUNCTION(log);
|
2021-10-28 21:28:04 +00:00
|
|
|
JS_DECLARE_NATIVE_FUNCTION(trace);
|
2023-06-22 01:27:14 +00:00
|
|
|
JS_DECLARE_NATIVE_FUNCTION(warn);
|
2024-08-09 21:24:26 +00:00
|
|
|
JS_DECLARE_NATIVE_FUNCTION(table);
|
2023-06-22 01:29:24 +00:00
|
|
|
JS_DECLARE_NATIVE_FUNCTION(dir);
|
2021-10-28 21:28:04 +00:00
|
|
|
JS_DECLARE_NATIVE_FUNCTION(count);
|
|
|
|
JS_DECLARE_NATIVE_FUNCTION(count_reset);
|
2021-12-22 12:32:15 +00:00
|
|
|
JS_DECLARE_NATIVE_FUNCTION(group);
|
|
|
|
JS_DECLARE_NATIVE_FUNCTION(group_collapsed);
|
|
|
|
JS_DECLARE_NATIVE_FUNCTION(group_end);
|
2021-12-22 16:40:57 +00:00
|
|
|
JS_DECLARE_NATIVE_FUNCTION(time);
|
|
|
|
JS_DECLARE_NATIVE_FUNCTION(time_log);
|
|
|
|
JS_DECLARE_NATIVE_FUNCTION(time_end);
|
2022-08-28 13:20:06 +00:00
|
|
|
|
2024-11-14 15:01:23 +00:00
|
|
|
GC::Ptr<Console> m_console;
|
2020-03-16 13:58:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|