diff options
author | Linus Groh <mail@linusgroh.de> | 2022-08-28 14:53:39 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-08-28 16:36:56 +0100 |
commit | 4f436bd323b147b77031d55cf916c4a6f26ae91f (patch) | |
tree | 83d2ace4bb6d1c36dcbf4ca59aab43bf3d10f80a /Userland | |
parent | cfa588585512540be5738b9b02511560a1126612 (diff) | |
download | serenity-4f436bd323b147b77031d55cf916c4a6f26ae91f.zip |
LibJS: Let NewGlobalEnvironment take a plain Object
The object is passed directly to NewObjectEnvironment, which has no
requirement for this being a JS::GlobalObject. This is needed for the
next change, which will make Realm store a plain Object as for the
global object as well.
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/GlobalEnvironment.cpp | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/GlobalEnvironment.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/GlobalEnvironment.cpp b/Userland/Libraries/LibJS/Runtime/GlobalEnvironment.cpp index c25e16efac..ec1dbc729e 100644 --- a/Userland/Libraries/LibJS/Runtime/GlobalEnvironment.cpp +++ b/Userland/Libraries/LibJS/Runtime/GlobalEnvironment.cpp @@ -15,7 +15,7 @@ namespace JS { // 9.1.2.5 NewGlobalEnvironment ( G, thisValue ), https://tc39.es/ecma262/#sec-newglobalenvironment -GlobalEnvironment::GlobalEnvironment(GlobalObject& global_object, Object& this_value) +GlobalEnvironment::GlobalEnvironment(Object& global_object, Object& this_value) : Environment(nullptr) , m_global_this_value(&this_value) { diff --git a/Userland/Libraries/LibJS/Runtime/GlobalEnvironment.h b/Userland/Libraries/LibJS/Runtime/GlobalEnvironment.h index 08e1557766..bed905d76f 100644 --- a/Userland/Libraries/LibJS/Runtime/GlobalEnvironment.h +++ b/Userland/Libraries/LibJS/Runtime/GlobalEnvironment.h @@ -14,7 +14,7 @@ class GlobalEnvironment final : public Environment { JS_ENVIRONMENT(GlobalEnvironment, Environment); public: - GlobalEnvironment(GlobalObject&, Object& this_value); + GlobalEnvironment(Object&, Object& this_value); virtual bool has_this_binding() const final { return true; } virtual ThrowCompletionOr<Value> get_this_binding(VM&) const final; |