1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 20:07:36 +00:00

LibJS: Introduce AbstractOperations.{cpp,h} and move various AOs there

Value.{cpp,h} has become a dumping ground, let's change that.

Things that are directly related to Values (e.g. bitwise/binary ops,
equality related functions) can remain, but everything else that's not a
Value or Object method and globally required (not just a static function
somewhere) is being moved.

Also convert to east-const while we're here.

I haven't touched IteratorOperations.{cpp,h}, it seems fine to still
have those separately.
This commit is contained in:
Linus Groh 2021-06-19 21:45:00 +01:00 committed by Andreas Kling
parent c03a3dc5b7
commit 55db9539a5
18 changed files with 153 additions and 100 deletions

View file

@ -0,0 +1,21 @@
/*
* Copyright (c) 2020-2021, Linus Groh <linusg@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Forward.h>
#include <LibJS/Forward.h>
#include <LibJS/Runtime/Value.h>
namespace JS {
Value require_object_coercible(GlobalObject&, Value);
Function* get_method(GlobalObject& global_object, Value, PropertyName const&);
size_t length_of_array_like(GlobalObject&, Object const&);
MarkedValueList create_list_from_array_like(GlobalObject&, Value, AK::Function<Result<void, ErrorType>(Value)> = {});
Function* species_constructor(GlobalObject&, Object const&, Function& default_constructor);
}