mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:18:11 +00:00
LibJS: Add support for async functions
This commit adds support for the most bare bones version of async functions, support for async generator functions, async arrow functions and await expressions are TODO.
This commit is contained in:
parent
05c3320da3
commit
681787de76
17 changed files with 399 additions and 36 deletions
|
@ -73,7 +73,7 @@ public:
|
|||
bool has_simple_parameter_list() const { return m_has_simple_parameter_list; }
|
||||
|
||||
// Equivalent to absence of [[Construct]]
|
||||
virtual bool has_constructor() const override { return !(m_is_arrow_function || m_kind == FunctionKind::Generator); }
|
||||
virtual bool has_constructor() const override { return m_kind == FunctionKind::Regular && !m_is_arrow_function; }
|
||||
|
||||
protected:
|
||||
virtual bool is_strict_mode() const final { return m_strict; }
|
||||
|
@ -87,6 +87,9 @@ private:
|
|||
void prepare_for_ordinary_call(ExecutionContext& callee_context, Object* new_target);
|
||||
void ordinary_call_bind_this(ExecutionContext&, Value this_argument);
|
||||
|
||||
void async_function_start(PromiseCapability const&);
|
||||
void async_block_start(PromiseCapability const&, ExecutionContext&);
|
||||
|
||||
ThrowCompletionOr<void> function_declaration_instantiation(Interpreter*);
|
||||
|
||||
// Internal Slots of ECMAScript Function Objects, https://tc39.es/ecma262/#table-internal-slots-of-ecmascript-function-objects
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue