Commit graph

59 commits

Author SHA1 Message Date
Linus Groh
2dba048146 LibJS: Remove unused FunctionObject::environment()
ECMAScriptFunctionObject::environment() can just be non-virtual.
2021-09-25 17:51:30 +02:00
Linus Groh
9043041dd3 LibJS: Move [[BoundThis]] and [[BoundArguments]] to BoundFunction 2021-09-25 17:51:30 +02:00
Linus Groh
a08292d76c LibJS: Move has_simple_parameter_list to ECMAScriptFunctionObject 2021-09-25 17:51:30 +02:00
Linus Groh
76eb8fe717 LibJS: Move [[Fields]] to ECMAScriptFunctionObject 2021-09-25 17:51:30 +02:00
Linus Groh
136451c3af LibJS: Move [[HomeObject]] to ECMAScriptFunctionObject 2021-09-25 17:51:30 +02:00
Linus Groh
06726d41ac LibJS: Move [[ConstructorKind]] to ECMAScriptFunctionObject 2021-09-25 17:51:30 +02:00
Linus Groh
1e97a85095 LibJS: Move [[ThisMode]] to ECMAScriptFunctionObject 2021-09-25 17:51:30 +02:00
Linus Groh
d5f90cf187 LibJS: Rename ECMAScriptFunctionObject members to match spec names
Also add the internal slot names as comments, and separate them into
groups of spec and non-spec members.
This will make it easier to compare the implementation code with the
spec, as well as identify internal slots currently missing or only
present on FunctionObject.
2021-09-25 17:51:30 +02:00
Linus Groh
e37cf73300 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]].
2021-09-25 17:51:30 +02:00
Renamed from Userland/Libraries/LibJS/Runtime/OrdinaryFunctionObject.h (Browse further)