1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:48:12 +00:00

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
parent f6d57c82f6
commit bc1ece7f37
30 changed files with 60 additions and 28 deletions

View file

@ -24,6 +24,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <LibJS/Interpreter.h>
#include <LibWeb/Bindings/EventWrapper.h>
#include <LibWeb/Bindings/MouseEventWrapper.h>
#include <LibWeb/DOM/MouseEvent.h>
@ -39,7 +40,8 @@ EventWrapper* wrap(JS::Heap& heap, Event& event)
}
EventWrapper::EventWrapper(Event& event)
: m_event(event)
: Wrapper(*interpreter().object_prototype())
, m_event(event)
{
}