1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:37:46 +00:00

LibJS: Re-implement console functions as wrappers around Console methods

Console methods are now Value(void) functions.

JavaScript functions in the JavaScript ConsoleObject are now implemented
as simple wrappers around Console methods.

This will make it possible for LibJS users to easily override the
default behaviour of JS console functions (even their return value!)
once we add a way to override Console behaviour.
This commit is contained in:
Emanuele Torre 2020-05-04 13:20:25 +02:00 committed by Andreas Kling
parent 73bead5ae9
commit 30519c22f6
3 changed files with 49 additions and 51 deletions

View file

@ -44,18 +44,18 @@ public:
HashMap<String, unsigned>& counters() { return m_counters; }
void debug(String text);
void error(String text);
void info(String text);
void log(String text);
void warn(String text);
Value debug();
Value error();
Value info();
Value log();
Value warn();
void clear();
Value clear();
void trace(String title);
Value trace();
void count(String label = "default");
void count_reset(String label = "default");
Value count();
Value count_reset();
private:
Interpreter& m_interpreter;