mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
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]].
This commit is contained in:
Notes:
sideshowbarker
2024-07-18 03:28:29 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/e37cf73300b Pull-request: https://github.com/SerenityOS/serenity/pull/10203 Reviewed-by: https://github.com/IdanHo ✅ Reviewed-by: https://github.com/davidot
@@ -7,8 +7,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <LibJS/Bytecode/Interpreter.h>
|
||||
#include <LibJS/Runtime/ECMAScriptFunctionObject.h>
|
||||
#include <LibJS/Runtime/Object.h>
|
||||
#include <LibJS/Runtime/OrdinaryFunctionObject.h>
|
||||
|
||||
namespace JS {
|
||||
|
||||
@@ -16,7 +16,7 @@ class GeneratorObject final : public Object {
|
||||
JS_OBJECT(GeneratorObject, Object);
|
||||
|
||||
public:
|
||||
static GeneratorObject* create(GlobalObject&, Value, OrdinaryFunctionObject*, Environment*, Bytecode::RegisterWindow);
|
||||
static GeneratorObject* create(GlobalObject&, Value, ECMAScriptFunctionObject*, Environment*, Bytecode::RegisterWindow);
|
||||
GeneratorObject(GlobalObject&, Object& prototype);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual ~GeneratorObject() override;
|
||||
@@ -27,7 +27,7 @@ public:
|
||||
|
||||
private:
|
||||
Environment* m_environment { nullptr };
|
||||
OrdinaryFunctionObject* m_generating_function { nullptr };
|
||||
ECMAScriptFunctionObject* m_generating_function { nullptr };
|
||||
Value m_previous_value;
|
||||
Bytecode::RegisterWindow m_frame;
|
||||
bool m_done { false };
|
||||
|
||||
Reference in New Issue
Block a user