#include #include #include #include #include #include #include #include namespace JS { GlobalObject::GlobalObject() { put_native_function("print", [](Interpreter&, Vector arguments) -> Value { for (auto& argument : arguments) printf("%s ", argument.to_string().characters()); return js_undefined(); }); put_native_function("gc", [](Interpreter& interpreter, Vector) -> Value { dbg() << "Forced garbage collection requested!"; interpreter.heap().collect_garbage(); return js_undefined(); }); } GlobalObject::~GlobalObject() { } }