From c00ff4ba62998e6ff15b0e941e34eaf587978867 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 2 May 2020 20:43:44 +0200 Subject: [PATCH] LibJS: Fix build (GlobalObject::add_constructor not visible in LibWeb) --- Libraries/LibJS/Runtime/GlobalObject.cpp | 9 --------- Libraries/LibJS/Runtime/GlobalObject.h | 10 ++++++++++ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Libraries/LibJS/Runtime/GlobalObject.cpp b/Libraries/LibJS/Runtime/GlobalObject.cpp index baaf16f62e..4b9497efd1 100644 --- a/Libraries/LibJS/Runtime/GlobalObject.cpp +++ b/Libraries/LibJS/Runtime/GlobalObject.cpp @@ -57,15 +57,6 @@ namespace JS { -template -void GlobalObject::add_constructor(const FlyString& property_name, ConstructorType*& constructor, Object& prototype) -{ - constructor = heap().allocate(); - constructor->put("name", js_string(heap(), property_name), Attribute::Configurable); - prototype.put("constructor", constructor); - put(property_name, constructor, Attribute::Writable | Attribute::Configurable); -} - GlobalObject::GlobalObject() : Object(nullptr) { diff --git a/Libraries/LibJS/Runtime/GlobalObject.h b/Libraries/LibJS/Runtime/GlobalObject.h index 811cc28007..9d6c52c8b7 100644 --- a/Libraries/LibJS/Runtime/GlobalObject.h +++ b/Libraries/LibJS/Runtime/GlobalObject.h @@ -26,6 +26,7 @@ #pragma once +#include #include namespace JS { @@ -67,4 +68,13 @@ private: #undef __JS_ENUMERATE }; +template +inline void GlobalObject::add_constructor(const FlyString& property_name, ConstructorType*& constructor, Object& prototype) +{ + constructor = heap().allocate(); + constructor->put("name", js_string(heap(), property_name), Attribute::Configurable); + prototype.put("constructor", constructor); + put(property_name, constructor, Attribute::Writable | Attribute::Configurable); +} + }