diff options
Diffstat (limited to 'Libraries/LibJS/Runtime/GlobalObject.cpp')
-rw-r--r-- | Libraries/LibJS/Runtime/GlobalObject.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Libraries/LibJS/Runtime/GlobalObject.cpp b/Libraries/LibJS/Runtime/GlobalObject.cpp index 9dd2b4e9d7..6096eb1eb7 100644 --- a/Libraries/LibJS/Runtime/GlobalObject.cpp +++ b/Libraries/LibJS/Runtime/GlobalObject.cpp @@ -28,6 +28,7 @@ #include <AK/LogStream.h> #include <LibJS/Interpreter.h> #include <LibJS/Runtime/ArrayConstructor.h> +#include <LibJS/Runtime/ArrayIteratorPrototype.h> #include <LibJS/Runtime/ArrayPrototype.h> #include <LibJS/Runtime/BigIntConstructor.h> #include <LibJS/Runtime/BigIntPrototype.h> @@ -41,6 +42,7 @@ #include <LibJS/Runtime/FunctionConstructor.h> #include <LibJS/Runtime/FunctionPrototype.h> #include <LibJS/Runtime/GlobalObject.h> +#include <LibJS/Runtime/IteratorPrototype.h> #include <LibJS/Runtime/JSONObject.h> #include <LibJS/Runtime/MathObject.h> #include <LibJS/Runtime/NativeFunction.h> @@ -84,6 +86,13 @@ void GlobalObject::initialize() JS_ENUMERATE_BUILTIN_TYPES #undef __JS_ENUMERATE +#define __JS_ENUMERATE(ClassName, snake_name) \ + if (!m_##snake_name##_prototype) \ + m_##snake_name##_prototype = heap().allocate<ClassName##Prototype>(*this, *this); + JS_ENUMERATE_ITERATOR_PROTOTYPES +#undef __JS_ENUMERATE + + u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function("gc", gc, 0, attr); define_native_function("isNaN", is_nan, 1, attr); |