mirror of
https://github.com/RGBCube/serenity
synced 2025-07-10 06:07:35 +00:00
LibJS: Allow implicit Value construction from GC-allocated things
This commit is contained in:
parent
7912f33ea0
commit
32963cf74a
4 changed files with 10 additions and 10 deletions
|
@ -38,11 +38,11 @@ Interpreter::Interpreter()
|
|||
: m_heap(*this)
|
||||
{
|
||||
m_global_object = heap().allocate<Object>();
|
||||
m_global_object->put("print", Value(heap().allocate<NativeFunction>([](Vector<Argument> arguments) -> Value {
|
||||
m_global_object->put("print", heap().allocate<NativeFunction>([](Vector<Argument> arguments) -> Value {
|
||||
for (auto& argument : arguments)
|
||||
printf("%s ", argument.value.to_string().characters());
|
||||
return js_undefined();
|
||||
})));
|
||||
}));
|
||||
}
|
||||
|
||||
Interpreter::~Interpreter()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue