1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 10:37:45 +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

@ -17,6 +17,7 @@
#include <AK/Types.h>
#include <LibJS/Forward.h>
#include <LibJS/Runtime/BigInt.h>
#include <LibJS/Runtime/PrimitiveString.h>
#include <math.h>
// 2 ** 53 - 1
@ -378,11 +379,6 @@ bool same_value(Value lhs, Value rhs);
bool same_value_zero(Value lhs, Value rhs);
bool same_value_non_numeric(Value lhs, Value rhs);
TriState abstract_relation(GlobalObject&, bool left_first, Value lhs, Value rhs);
Function* get_method(GlobalObject& global_object, Value, const PropertyName&);
size_t length_of_array_like(GlobalObject&, const Object&);
Function* species_constructor(GlobalObject&, const Object&, Function& default_constructor);
Value require_object_coercible(GlobalObject&, Value);
MarkedValueList create_list_from_array_like(GlobalObject&, Value, AK::Function<Result<void, ErrorType>(Value)> = {});
struct ValueTraits : public Traits<Value> {
static unsigned hash(Value value)