mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 15:16:14 +00:00
LibJS: Replace the global print() function with console.log() :^)
This commit is contained in:
@@ -6,17 +6,12 @@
|
||||
#include <LibJS/Runtime/GlobalObject.h>
|
||||
#include <LibJS/Runtime/NativeFunction.h>
|
||||
#include <LibJS/Runtime/Value.h>
|
||||
#include <stdio.h>
|
||||
|
||||
namespace JS {
|
||||
|
||||
GlobalObject::GlobalObject()
|
||||
{
|
||||
put_native_function("print", [](Object*, Vector<Value> arguments) -> Value {
|
||||
for (auto& argument : arguments)
|
||||
printf("%s ", argument.to_string().characters());
|
||||
return js_undefined();
|
||||
});
|
||||
put("console", heap().allocate<ConsoleObject>());
|
||||
put_native_function("gc", [](Object* this_object, Vector<Value>) -> Value {
|
||||
dbg() << "Forced garbage collection requested!";
|
||||
this_object->heap().collect_garbage();
|
||||
|
||||
Reference in New Issue
Block a user