mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 11:20:03 +00:00
LibJS: Move builtin prototypes to the global object
This moves us towards being able to run JavaScript in different global objects without allocating a separate GC heap.
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
|
||||
#include <LibJS/Interpreter.h>
|
||||
#include <LibJS/Runtime/Error.h>
|
||||
#include <LibJS/Runtime/GlobalObject.h>
|
||||
#include <LibJS/Runtime/StringConstructor.h>
|
||||
#include <LibJS/Runtime/StringObject.h>
|
||||
#include <math.h>
|
||||
@@ -33,9 +34,9 @@
|
||||
namespace JS {
|
||||
|
||||
StringConstructor::StringConstructor()
|
||||
: NativeFunction("String", *interpreter().function_prototype())
|
||||
: NativeFunction("String", *interpreter().global_object().function_prototype())
|
||||
{
|
||||
put("prototype", interpreter().string_prototype());
|
||||
put("prototype", interpreter().global_object().string_prototype());
|
||||
put("length", Value(1));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user