mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 18:15:07 +00:00
LibJS: Add "Heap" and "Runtime" subdirectories
Let's try to keep LibJS tidy as it expands. :^)
This commit is contained in:
parent
6780d70fb1
commit
19452230cd
39 changed files with 99 additions and 98 deletions
|
@ -1,30 +0,0 @@
|
|||
#include <AK/LogStream.h>
|
||||
#include <AK/String.h>
|
||||
#include <LibJS/GlobalObject.h>
|
||||
#include <LibJS/Heap.h>
|
||||
#include <LibJS/Interpreter.h>
|
||||
#include <LibJS/NativeFunction.h>
|
||||
#include <LibJS/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_native_function("gc", [](Object* this_object, Vector<Value>) -> Value {
|
||||
dbg() << "Forced garbage collection requested!";
|
||||
this_object->heap().collect_garbage();
|
||||
return js_undefined();
|
||||
});
|
||||
}
|
||||
|
||||
GlobalObject::~GlobalObject()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue