diff options
author | Idan Horowitz <idan.horowitz@gmail.com> | 2021-06-30 17:54:47 +0300 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-06-30 18:41:32 +0100 |
commit | 5606332ed72e60fa720cf17ad055cca8d2d36b05 (patch) | |
tree | adcc4254d415b34ea43b983df38a37821dd590f8 /Userland/Libraries/LibJS/Runtime/NativeFunction.h | |
parent | 38b8fa8f3e2f0ff0174b9cb9bd7345b74b155931 (diff) | |
download | serenity-5606332ed72e60fa720cf17ad055cca8d2d36b05.zip |
LibJS: Add a [[Realm]] getter to FunctionObject and use it where needed
Defined by https://tc39.es/ecma262/#sec-ordinaryfunctioncreate step #17
and by https://tc39.es/ecma262/#sec-createbuiltinfunction step #6.
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/NativeFunction.h')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/NativeFunction.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/NativeFunction.h b/Userland/Libraries/LibJS/Runtime/NativeFunction.h index aa7899f456..39d66edb76 100644 --- a/Userland/Libraries/LibJS/Runtime/NativeFunction.h +++ b/Userland/Libraries/LibJS/Runtime/NativeFunction.h @@ -29,6 +29,8 @@ public: virtual bool is_strict_mode() const override; + GlobalObject* realm() const override { return &global_object(); } + protected: NativeFunction(FlyString name, Object& prototype); explicit NativeFunction(Object& prototype); |