1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:47:44 +00:00

LibJS: Add the CreateMappedArgumentsObject abstract operation

This patch adds a new ArgumentsObject class to represent what the spec
calls "Arguments Exotic Objects"

These are constructed by the new CreateMappedArgumentsObject when the
`arguments` identifier is resolved in a callee context.

The implementation is incomplete and doesn't yet support mapping of
the parameter variables to the indexed properties of `arguments`.
This commit is contained in:
Andreas Kling 2021-06-28 13:26:01 +02:00
parent a55cf08ef9
commit 2d4eb40f59
8 changed files with 95 additions and 10 deletions

View file

@ -7,6 +7,7 @@
#pragma once
#include <AK/Forward.h>
#include <LibJS/AST.h>
#include <LibJS/Forward.h>
#include <LibJS/Runtime/GlobalObject.h>
#include <LibJS/Runtime/Value.h>
@ -24,6 +25,7 @@ FunctionObject* species_constructor(GlobalObject&, Object const&, FunctionObject
GlobalObject* get_function_realm(GlobalObject&, FunctionObject const&);
Object* get_prototype_from_constructor(GlobalObject&, FunctionObject const& constructor, Object* (GlobalObject::*intrinsic_default_prototype)());
Object* create_unmapped_arguments_object(GlobalObject&, Vector<Value> const& arguments);
Object* create_mapped_arguments_object(GlobalObject&, FunctionObject&, Vector<FunctionNode::Parameter> const&, Vector<Value> const& arguments, EnvironmentRecord&);
enum class CallerMode {
Strict,