LibJS+LibWeb: Pass prototype to Object constructor

Everyone who constructs an Object must now pass a prototype object when
applicable. There's still a fair amount of code that passes something
fetched from the Interpreter, but this brings us closer to being able
to detach prototypes from Interpreter eventually.
This commit is contained in:
Andreas Kling 2020-04-18 10:27:57 +02:00
commit bc1ece7f37
Notes: sideshowbarker 2024-07-19 07:31:28 +09:00
30 changed files with 60 additions and 28 deletions

View file

@ -27,9 +27,9 @@
#include <AK/Function.h>
#include <LibJS/Interpreter.h>
#include <LibJS/Runtime/Array.h>
#include <LibJS/Runtime/GlobalObject.h>
#include <LibJS/Runtime/ArrayPrototype.h>
#include <LibJS/Runtime/Error.h>
#include <LibJS/Runtime/GlobalObject.h>
namespace JS {
@ -40,8 +40,8 @@ Array* Array::create(GlobalObject& global_object)
}
Array::Array(Object& prototype)
: Object(&prototype)
{
set_prototype(&prototype);
put_native_property("length", length_getter, length_setter);
}