diff options
author | Linus Groh <mail@linusgroh.de> | 2021-09-24 22:40:38 +0200 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-09-25 17:51:30 +0200 |
commit | e37cf73300bcb34b0f109cc342b7042f59a73f5a (patch) | |
tree | ef23602b4cc653036203eb356f20700a254fda0c /Userland/Utilities/js.cpp | |
parent | d78777580633f5a41bb467945fbb50df7e5d674c (diff) | |
download | serenity-e37cf73300bcb34b0f109cc342b7042f59a73f5a.zip |
LibJS: Rename OrdinaryFunctionObject to ECMAScriptFunctionObject
The old name is the result of the perhaps somewhat confusingly named
abstract operation OrdinaryFunctionCreate(), which creates an "ordinary
object" (https://tc39.es/ecma262/#ordinary-object) in contrast to an
"exotic object" (https://tc39.es/ecma262/#exotic-object).
However, the term "Ordinary Function" is not used anywhere in the spec,
instead the created object is referred to as an "ECMAScript Function
Object" (https://tc39.es/ecma262/#sec-ecmascript-function-objects), so
let's call it that.
The "ordinary" vs. "exotic" distinction is important because there are
also "Built-in Function Objects", which can be either implemented as
ordinary ECMAScript function objects, or as exotic objects (our
NativeFunction).
More work needs to be done to move a lot of infrastructure to
ECMAScriptFunctionObject in order to make FunctionObject nothing more
than an interface for objects that implement [[Call]] and optionally
[[Construct]].
Diffstat (limited to 'Userland/Utilities/js.cpp')
-rw-r--r-- | Userland/Utilities/js.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Userland/Utilities/js.cpp b/Userland/Utilities/js.cpp index 4d8ad054e7..6c0346021b 100644 --- a/Userland/Utilities/js.cpp +++ b/Userland/Utilities/js.cpp @@ -26,6 +26,7 @@ #include <LibJS/Runtime/BooleanObject.h> #include <LibJS/Runtime/DataView.h> #include <LibJS/Runtime/Date.h> +#include <LibJS/Runtime/ECMAScriptFunctionObject.h> #include <LibJS/Runtime/Error.h> #include <LibJS/Runtime/FunctionObject.h> #include <LibJS/Runtime/GlobalObject.h> @@ -38,7 +39,6 @@ #include <LibJS/Runtime/NativeFunction.h> #include <LibJS/Runtime/NumberObject.h> #include <LibJS/Runtime/Object.h> -#include <LibJS/Runtime/OrdinaryFunctionObject.h> #include <LibJS/Runtime/PrimitiveString.h> #include <LibJS/Runtime/Promise.h> #include <LibJS/Runtime/ProxyObject.h> @@ -255,8 +255,8 @@ static void print_object(JS::Object& object, HashTable<JS::Object*>& seen_object static void print_function(JS::Object const& object, HashTable<JS::Object*>&) { print_type(object.class_name()); - if (is<JS::OrdinaryFunctionObject>(object)) - out(" {}", static_cast<JS::OrdinaryFunctionObject const&>(object).name()); + if (is<JS::ECMAScriptFunctionObject>(object)) + out(" {}", static_cast<JS::ECMAScriptFunctionObject const&>(object).name()); else if (is<JS::NativeFunction>(object)) out(" {}", static_cast<JS::NativeFunction const&>(object).name()); } |