mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:17:36 +00:00
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.
This commit is contained in:
parent
cfa5885855
commit
4f436bd323
2 changed files with 2 additions and 2 deletions
|
@ -15,7 +15,7 @@
|
||||||
namespace JS {
|
namespace JS {
|
||||||
|
|
||||||
// 9.1.2.5 NewGlobalEnvironment ( G, thisValue ), https://tc39.es/ecma262/#sec-newglobalenvironment
|
// 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)
|
: Environment(nullptr)
|
||||||
, m_global_this_value(&this_value)
|
, m_global_this_value(&this_value)
|
||||||
{
|
{
|
||||||
|
|
|
@ -14,7 +14,7 @@ class GlobalEnvironment final : public Environment {
|
||||||
JS_ENVIRONMENT(GlobalEnvironment, Environment);
|
JS_ENVIRONMENT(GlobalEnvironment, Environment);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GlobalEnvironment(GlobalObject&, Object& this_value);
|
GlobalEnvironment(Object&, Object& this_value);
|
||||||
|
|
||||||
virtual bool has_this_binding() const final { return true; }
|
virtual bool has_this_binding() const final { return true; }
|
||||||
virtual ThrowCompletionOr<Value> get_this_binding(VM&) const final;
|
virtual ThrowCompletionOr<Value> get_this_binding(VM&) const final;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue