mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 09:14:58 +00:00
LibJS: Hide all the constructors!
Now that the GC allocator is able to invoke Cell subclass constructors directly via friendship, we no longer need to keep them public. :^)
This commit is contained in:
parent
d54ba587f3
commit
35c9aa7c05
196 changed files with 456 additions and 242 deletions
|
@ -17,11 +17,12 @@ class $262Object final : public Object {
|
|||
JS_OBJECT($262Object, Object);
|
||||
|
||||
public:
|
||||
explicit $262Object(Realm&);
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual ~$262Object() override = default;
|
||||
|
||||
private:
|
||||
explicit $262Object(Realm&);
|
||||
|
||||
virtual void visit_edges(Visitor&) override;
|
||||
|
||||
AgentObject* m_agent { nullptr };
|
||||
|
|
|
@ -15,11 +15,12 @@ class AgentObject final : public Object {
|
|||
JS_OBJECT(AgentObject, Object);
|
||||
|
||||
public:
|
||||
explicit AgentObject(Realm&);
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual ~AgentObject() override = default;
|
||||
|
||||
private:
|
||||
explicit AgentObject(Realm&);
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(monotonic_now);
|
||||
JS_DECLARE_NATIVE_FUNCTION(sleep);
|
||||
};
|
||||
|
|
|
@ -15,16 +15,17 @@ class GlobalObject final : public JS::GlobalObject {
|
|||
JS_OBJECT(GlobalObject, JS::GlobalObject);
|
||||
|
||||
public:
|
||||
GlobalObject(JS::Realm& realm)
|
||||
: JS::GlobalObject(realm)
|
||||
{
|
||||
}
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~GlobalObject() override = default;
|
||||
|
||||
$262Object* $262() const { return m_$262; }
|
||||
|
||||
private:
|
||||
GlobalObject(JS::Realm& realm)
|
||||
: JS::GlobalObject(realm)
|
||||
{
|
||||
}
|
||||
|
||||
virtual void visit_edges(Visitor&) override;
|
||||
|
||||
$262Object* m_$262 { nullptr };
|
||||
|
|
|
@ -14,12 +14,13 @@ class IsHTMLDDA final : public NativeFunction {
|
|||
JS_OBJECT(IsHTMLDDA, NativeFunction);
|
||||
|
||||
public:
|
||||
explicit IsHTMLDDA(Realm&);
|
||||
virtual ~IsHTMLDDA() override = default;
|
||||
|
||||
virtual ThrowCompletionOr<Value> call() override;
|
||||
|
||||
private:
|
||||
explicit IsHTMLDDA(Realm&);
|
||||
|
||||
virtual bool is_htmldda() const override { return true; }
|
||||
};
|
||||
|
||||
|
|
|
@ -22,12 +22,6 @@ public:
|
|||
return vm.heap().allocate_without_realm<Accessor>(getter, setter);
|
||||
}
|
||||
|
||||
Accessor(FunctionObject* getter, FunctionObject* setter)
|
||||
: m_getter(getter)
|
||||
, m_setter(setter)
|
||||
{
|
||||
}
|
||||
|
||||
FunctionObject* getter() const { return m_getter; }
|
||||
void set_getter(FunctionObject* getter) { m_getter = getter; }
|
||||
|
||||
|
@ -41,6 +35,12 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
Accessor(FunctionObject* getter, FunctionObject* setter)
|
||||
: m_getter(getter)
|
||||
, m_setter(setter)
|
||||
{
|
||||
}
|
||||
|
||||
FunctionObject* m_getter { nullptr };
|
||||
FunctionObject* m_setter { nullptr };
|
||||
};
|
||||
|
|
|
@ -16,9 +16,10 @@ class AggregateError : public Error {
|
|||
|
||||
public:
|
||||
static AggregateError* create(Realm&);
|
||||
|
||||
explicit AggregateError(Object& prototype);
|
||||
virtual ~AggregateError() override = default;
|
||||
|
||||
private:
|
||||
explicit AggregateError(Object& prototype);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -14,7 +14,6 @@ class AggregateErrorConstructor final : public NativeFunction {
|
|||
JS_OBJECT(AggregateErrorConstructor, NativeFunction);
|
||||
|
||||
public:
|
||||
explicit AggregateErrorConstructor(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~AggregateErrorConstructor() override = default;
|
||||
|
||||
|
@ -22,6 +21,7 @@ public:
|
|||
virtual ThrowCompletionOr<Object*> construct(FunctionObject& new_target) override;
|
||||
|
||||
private:
|
||||
explicit AggregateErrorConstructor(Realm&);
|
||||
virtual bool has_constructor() const override { return true; }
|
||||
};
|
||||
|
||||
|
|
|
@ -14,9 +14,11 @@ class AggregateErrorPrototype final : public Object {
|
|||
JS_OBJECT(AggregateErrorPrototype, Object);
|
||||
|
||||
public:
|
||||
explicit AggregateErrorPrototype(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~AggregateErrorPrototype() override = default;
|
||||
|
||||
private:
|
||||
explicit AggregateErrorPrototype(Realm&);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -16,8 +16,6 @@ class ArgumentsObject final : public Object {
|
|||
JS_OBJECT(ArgumentsObject, Object);
|
||||
|
||||
public:
|
||||
ArgumentsObject(Realm&, Environment&);
|
||||
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~ArgumentsObject() override = default;
|
||||
|
||||
|
@ -33,6 +31,8 @@ public:
|
|||
Object& parameter_map() { return *m_parameter_map; }
|
||||
|
||||
private:
|
||||
ArgumentsObject(Realm&, Environment&);
|
||||
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
Environment& m_environment;
|
||||
|
|
|
@ -44,6 +44,9 @@ public:
|
|||
|
||||
[[nodiscard]] bool length_is_writable() const { return m_length_writable; };
|
||||
|
||||
protected:
|
||||
explicit Array(Object& prototype);
|
||||
|
||||
private:
|
||||
ThrowCompletionOr<bool> set_length(PropertyDescriptor const&);
|
||||
|
||||
|
|
|
@ -29,8 +29,6 @@ public:
|
|||
static ArrayBuffer* create(Realm&, ByteBuffer);
|
||||
static ArrayBuffer* create(Realm&, ByteBuffer*);
|
||||
|
||||
ArrayBuffer(ByteBuffer buffer, Object& prototype);
|
||||
ArrayBuffer(ByteBuffer* buffer, Object& prototype);
|
||||
virtual ~ArrayBuffer() override = default;
|
||||
|
||||
size_t byte_length() const { return buffer_impl().size(); }
|
||||
|
@ -58,6 +56,9 @@ public:
|
|||
Value get_modify_set_value(size_t byte_index, Value value, ReadWriteModifyFunction operation, bool is_little_endian = true);
|
||||
|
||||
private:
|
||||
ArrayBuffer(ByteBuffer buffer, Object& prototype);
|
||||
ArrayBuffer(ByteBuffer* buffer, Object& prototype);
|
||||
|
||||
virtual void visit_edges(Visitor&) override;
|
||||
|
||||
ByteBuffer& buffer_impl()
|
||||
|
|
|
@ -14,7 +14,6 @@ class ArrayBufferConstructor final : public NativeFunction {
|
|||
JS_OBJECT(ArrayBufferConstructor, NativeFunction);
|
||||
|
||||
public:
|
||||
explicit ArrayBufferConstructor(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~ArrayBufferConstructor() override = default;
|
||||
|
||||
|
@ -22,6 +21,8 @@ public:
|
|||
virtual ThrowCompletionOr<Object*> construct(FunctionObject& new_target) override;
|
||||
|
||||
private:
|
||||
explicit ArrayBufferConstructor(Realm&);
|
||||
|
||||
virtual bool has_constructor() const override { return true; }
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(is_view);
|
||||
|
|
|
@ -15,11 +15,12 @@ class ArrayBufferPrototype final : public PrototypeObject<ArrayBufferPrototype,
|
|||
JS_PROTOTYPE_OBJECT(ArrayBufferPrototype, ArrayBuffer, ArrayBuffer);
|
||||
|
||||
public:
|
||||
explicit ArrayBufferPrototype(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~ArrayBufferPrototype() override = default;
|
||||
|
||||
private:
|
||||
explicit ArrayBufferPrototype(Realm&);
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(slice);
|
||||
JS_DECLARE_NATIVE_FUNCTION(byte_length_getter);
|
||||
};
|
||||
|
|
|
@ -14,7 +14,6 @@ class ArrayConstructor final : public NativeFunction {
|
|||
JS_OBJECT(ArrayConstructor, NativeFunction);
|
||||
|
||||
public:
|
||||
explicit ArrayConstructor(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~ArrayConstructor() override = default;
|
||||
|
||||
|
@ -22,6 +21,8 @@ public:
|
|||
virtual ThrowCompletionOr<Object*> construct(FunctionObject& new_target) override;
|
||||
|
||||
private:
|
||||
explicit ArrayConstructor(Realm&);
|
||||
|
||||
virtual bool has_constructor() const override { return true; }
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(from);
|
||||
|
|
|
@ -16,7 +16,6 @@ class ArrayIterator final : public Object {
|
|||
public:
|
||||
static ArrayIterator* create(Realm&, Value array, Object::PropertyKind iteration_kind);
|
||||
|
||||
explicit ArrayIterator(Value array, Object::PropertyKind iteration_kind, Object& prototype);
|
||||
virtual ~ArrayIterator() override = default;
|
||||
|
||||
Value array() const { return m_array; }
|
||||
|
@ -26,6 +25,8 @@ public:
|
|||
private:
|
||||
friend class ArrayIteratorPrototype;
|
||||
|
||||
ArrayIterator(Value array, Object::PropertyKind iteration_kind, Object& prototype);
|
||||
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
Value m_array;
|
||||
|
|
|
@ -15,11 +15,12 @@ class ArrayIteratorPrototype final : public PrototypeObject<ArrayIteratorPrototy
|
|||
JS_PROTOTYPE_OBJECT(ArrayIteratorPrototype, ArrayIterator, ArrayIterator);
|
||||
|
||||
public:
|
||||
ArrayIteratorPrototype(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~ArrayIteratorPrototype() override = default;
|
||||
|
||||
private:
|
||||
explicit ArrayIteratorPrototype(Realm&);
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(next);
|
||||
};
|
||||
|
||||
|
|
|
@ -15,11 +15,12 @@ class ArrayPrototype final : public Array {
|
|||
JS_OBJECT(ArrayPrototype, Array);
|
||||
|
||||
public:
|
||||
ArrayPrototype(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~ArrayPrototype() override = default;
|
||||
|
||||
private:
|
||||
explicit ArrayPrototype(Realm&);
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(at);
|
||||
JS_DECLARE_NATIVE_FUNCTION(concat);
|
||||
JS_DECLARE_NATIVE_FUNCTION(copy_within);
|
||||
|
|
|
@ -19,7 +19,6 @@ class AsyncFromSyncIterator final : public Object {
|
|||
public:
|
||||
static AsyncFromSyncIterator* create(Realm&, Iterator sync_iterator_record);
|
||||
|
||||
explicit AsyncFromSyncIterator(Realm&, Iterator sync_iterator_record);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~AsyncFromSyncIterator() override = default;
|
||||
|
||||
|
@ -29,6 +28,8 @@ public:
|
|||
Iterator const& sync_iterator_record() const { return m_sync_iterator_record; }
|
||||
|
||||
private:
|
||||
AsyncFromSyncIterator(Realm&, Iterator sync_iterator_record);
|
||||
|
||||
Iterator m_sync_iterator_record; // [[SyncIteratorRecord]]
|
||||
};
|
||||
|
||||
|
|
|
@ -19,11 +19,12 @@ class AsyncFromSyncIteratorPrototype final : public PrototypeObject<AsyncFromSyn
|
|||
JS_PROTOTYPE_OBJECT(AsyncFromSyncIteratorPrototype, AsyncFromSyncIterator, AsyncFromSyncIterator);
|
||||
|
||||
public:
|
||||
explicit AsyncFromSyncIteratorPrototype(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~AsyncFromSyncIteratorPrototype() override = default;
|
||||
|
||||
private:
|
||||
explicit AsyncFromSyncIteratorPrototype(Realm&);
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(next);
|
||||
JS_DECLARE_NATIVE_FUNCTION(return_);
|
||||
JS_DECLARE_NATIVE_FUNCTION(throw_);
|
||||
|
|
|
@ -15,7 +15,6 @@ class AsyncFunctionConstructor final : public NativeFunction {
|
|||
JS_OBJECT(AsyncFunctionConstructor, NativeFunction);
|
||||
|
||||
public:
|
||||
explicit AsyncFunctionConstructor(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~AsyncFunctionConstructor() override = default;
|
||||
|
||||
|
@ -23,6 +22,8 @@ public:
|
|||
virtual ThrowCompletionOr<Object*> construct(FunctionObject& new_target) override;
|
||||
|
||||
private:
|
||||
explicit AsyncFunctionConstructor(Realm&);
|
||||
|
||||
virtual bool has_constructor() const override { return true; }
|
||||
};
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@ class AsyncFunctionDriverWrapper final : public Promise {
|
|||
|
||||
public:
|
||||
static ThrowCompletionOr<Value> create(Realm&, GeneratorObject*);
|
||||
explicit AsyncFunctionDriverWrapper(Realm&, GeneratorObject*);
|
||||
|
||||
virtual ~AsyncFunctionDriverWrapper() override = default;
|
||||
void visit_edges(Cell::Visitor&) override;
|
||||
|
@ -27,6 +26,8 @@ public:
|
|||
ThrowCompletionOr<Value> react_to_async_task_completion(VM&, Value, bool is_successful);
|
||||
|
||||
private:
|
||||
AsyncFunctionDriverWrapper(Realm&, GeneratorObject*);
|
||||
|
||||
GeneratorObject* m_generator_object { nullptr };
|
||||
NativeFunction* m_on_fulfillment { nullptr };
|
||||
NativeFunction* m_on_rejection { nullptr };
|
||||
|
|
|
@ -14,9 +14,11 @@ class AsyncFunctionPrototype final : public Object {
|
|||
JS_OBJECT(AsyncFunctionPrototype, Object);
|
||||
|
||||
public:
|
||||
explicit AsyncFunctionPrototype(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~AsyncFunctionPrototype() override = default;
|
||||
|
||||
private:
|
||||
explicit AsyncFunctionPrototype(Realm&);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -26,10 +26,11 @@ public:
|
|||
Completed,
|
||||
};
|
||||
|
||||
explicit AsyncGenerator(Object& prototype);
|
||||
virtual ~AsyncGenerator() override = default;
|
||||
|
||||
private:
|
||||
explicit AsyncGenerator(Object& prototype);
|
||||
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
// At the time of constructing an AsyncGenerator, we still need to point to an
|
||||
|
|
|
@ -14,7 +14,6 @@ class AsyncGeneratorFunctionConstructor final : public NativeFunction {
|
|||
JS_OBJECT(AsyncGeneratorFunctionConstructor, NativeFunction);
|
||||
|
||||
public:
|
||||
explicit AsyncGeneratorFunctionConstructor(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~AsyncGeneratorFunctionConstructor() override = default;
|
||||
|
||||
|
@ -22,6 +21,8 @@ public:
|
|||
virtual ThrowCompletionOr<Object*> construct(FunctionObject& new_target) override;
|
||||
|
||||
private:
|
||||
explicit AsyncGeneratorFunctionConstructor(Realm&);
|
||||
|
||||
virtual bool has_constructor() const override { return true; }
|
||||
};
|
||||
|
||||
|
|
|
@ -14,9 +14,11 @@ class AsyncGeneratorFunctionPrototype final : public PrototypeObject<AsyncGenera
|
|||
JS_PROTOTYPE_OBJECT(AsyncGeneratorFunctionPrototype, AsyncGeneratorFunction, AsyncGeneratorFunction);
|
||||
|
||||
public:
|
||||
explicit AsyncGeneratorFunctionPrototype(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~AsyncGeneratorFunctionPrototype() override = default;
|
||||
|
||||
private:
|
||||
explicit AsyncGeneratorFunctionPrototype(Realm&);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -15,9 +15,11 @@ class AsyncGeneratorPrototype final : public PrototypeObject<AsyncGeneratorProto
|
|||
JS_PROTOTYPE_OBJECT(AsyncGeneratorPrototype, AsyncGenerator, AsyncGenerator)
|
||||
|
||||
public:
|
||||
explicit AsyncGeneratorPrototype(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~AsyncGeneratorPrototype() override = default;
|
||||
|
||||
private:
|
||||
explicit AsyncGeneratorPrototype(Realm&);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -14,11 +14,12 @@ class AsyncIteratorPrototype final : public Object {
|
|||
JS_OBJECT(AsyncIteratorPrototype, Object)
|
||||
|
||||
public:
|
||||
explicit AsyncIteratorPrototype(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~AsyncIteratorPrototype() override = default;
|
||||
|
||||
private:
|
||||
explicit AsyncIteratorPrototype(Realm&);
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(symbol_async_iterator);
|
||||
};
|
||||
|
||||
|
|
|
@ -14,11 +14,12 @@ class AtomicsObject : public Object {
|
|||
JS_OBJECT(AtomicsObject, Object);
|
||||
|
||||
public:
|
||||
explicit AtomicsObject(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~AtomicsObject() override = default;
|
||||
|
||||
private:
|
||||
explicit AtomicsObject(Realm&);
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(add);
|
||||
JS_DECLARE_NATIVE_FUNCTION(and_);
|
||||
JS_DECLARE_NATIVE_FUNCTION(compare_exchange);
|
||||
|
|
|
@ -16,13 +16,14 @@ class BigInt final : public Cell {
|
|||
JS_CELL(BigInt, Cell);
|
||||
|
||||
public:
|
||||
explicit BigInt(Crypto::SignedBigInteger);
|
||||
virtual ~BigInt() override = default;
|
||||
|
||||
Crypto::SignedBigInteger const& big_integer() const { return m_big_integer; }
|
||||
const String to_string() const { return String::formatted("{}n", m_big_integer.to_base(10)); }
|
||||
|
||||
private:
|
||||
explicit BigInt(Crypto::SignedBigInteger);
|
||||
|
||||
Crypto::SignedBigInteger m_big_integer;
|
||||
};
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@ class BigIntConstructor final : public NativeFunction {
|
|||
JS_OBJECT(BigIntConstructor, NativeFunction);
|
||||
|
||||
public:
|
||||
explicit BigIntConstructor(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~BigIntConstructor() override = default;
|
||||
|
||||
|
@ -22,6 +21,8 @@ public:
|
|||
virtual ThrowCompletionOr<Object*> construct(FunctionObject& new_target) override;
|
||||
|
||||
private:
|
||||
explicit BigIntConstructor(Realm&);
|
||||
|
||||
virtual bool has_constructor() const override { return true; }
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(as_int_n);
|
||||
|
|
|
@ -17,13 +17,14 @@ class BigIntObject final : public Object {
|
|||
public:
|
||||
static BigIntObject* create(Realm&, BigInt&);
|
||||
|
||||
BigIntObject(BigInt&, Object& prototype);
|
||||
virtual ~BigIntObject() override = default;
|
||||
|
||||
BigInt const& bigint() const { return m_bigint; }
|
||||
BigInt& bigint() { return m_bigint; }
|
||||
|
||||
private:
|
||||
BigIntObject(BigInt&, Object& prototype);
|
||||
|
||||
virtual void visit_edges(Visitor&) override;
|
||||
|
||||
BigInt& m_bigint;
|
||||
|
|
|
@ -14,11 +14,12 @@ class BigIntPrototype final : public Object {
|
|||
JS_OBJECT(BigIntPrototype, Object);
|
||||
|
||||
public:
|
||||
explicit BigIntPrototype(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~BigIntPrototype() override = default;
|
||||
|
||||
private:
|
||||
explicit BigIntPrototype(Realm&);
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(to_string);
|
||||
JS_DECLARE_NATIVE_FUNCTION(to_locale_string);
|
||||
JS_DECLARE_NATIVE_FUNCTION(value_of);
|
||||
|
|
|
@ -14,7 +14,6 @@ class BooleanConstructor final : public NativeFunction {
|
|||
JS_OBJECT(BooleanConstructor, NativeFunction);
|
||||
|
||||
public:
|
||||
explicit BooleanConstructor(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~BooleanConstructor() override = default;
|
||||
|
||||
|
@ -22,6 +21,8 @@ public:
|
|||
virtual ThrowCompletionOr<Object*> construct(FunctionObject& new_target) override;
|
||||
|
||||
private:
|
||||
explicit BooleanConstructor(Realm&);
|
||||
|
||||
virtual bool has_constructor() const override { return true; }
|
||||
};
|
||||
|
||||
|
|
|
@ -16,11 +16,13 @@ class BooleanObject : public Object {
|
|||
public:
|
||||
static BooleanObject* create(Realm&, bool);
|
||||
|
||||
BooleanObject(bool, Object& prototype);
|
||||
virtual ~BooleanObject() override = default;
|
||||
|
||||
bool boolean() const { return m_value; }
|
||||
|
||||
protected:
|
||||
BooleanObject(bool, Object& prototype);
|
||||
|
||||
private:
|
||||
bool m_value { false };
|
||||
};
|
||||
|
|
|
@ -14,11 +14,12 @@ class BooleanPrototype final : public BooleanObject {
|
|||
JS_OBJECT(BooleanPrototype, BooleanObject);
|
||||
|
||||
public:
|
||||
explicit BooleanPrototype(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~BooleanPrototype() override = default;
|
||||
|
||||
private:
|
||||
explicit BooleanPrototype(Realm&);
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(to_string);
|
||||
JS_DECLARE_NATIVE_FUNCTION(value_of);
|
||||
};
|
||||
|
|
|
@ -17,7 +17,6 @@ class BoundFunction final : public FunctionObject {
|
|||
public:
|
||||
static ThrowCompletionOr<BoundFunction*> create(Realm&, FunctionObject& target_function, Value bound_this, Vector<Value> bound_arguments);
|
||||
|
||||
BoundFunction(Realm&, FunctionObject& target_function, Value bound_this, Vector<Value> bound_arguments, Object* prototype);
|
||||
virtual ~BoundFunction() override = default;
|
||||
|
||||
virtual ThrowCompletionOr<Value> internal_call(Value this_argument, MarkedVector<Value> arguments_list) override;
|
||||
|
@ -32,6 +31,8 @@ public:
|
|||
Vector<Value> const& bound_arguments() const { return m_bound_arguments; }
|
||||
|
||||
private:
|
||||
BoundFunction(Realm&, FunctionObject& target_function, Value bound_this, Vector<Value> bound_arguments, Object* prototype);
|
||||
|
||||
virtual void visit_edges(Visitor&) override;
|
||||
|
||||
FunctionObject* m_bound_target_function { nullptr }; // [[BoundTargetFunction]]
|
||||
|
|
|
@ -14,13 +14,14 @@ class ConsoleObject final : public Object {
|
|||
JS_OBJECT(ConsoleObject, Object);
|
||||
|
||||
public:
|
||||
explicit ConsoleObject(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~ConsoleObject() override = default;
|
||||
|
||||
Console& console() { return *m_console; }
|
||||
|
||||
private:
|
||||
explicit ConsoleObject(Realm&);
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(log);
|
||||
JS_DECLARE_NATIVE_FUNCTION(debug);
|
||||
JS_DECLARE_NATIVE_FUNCTION(info);
|
||||
|
|
|
@ -18,7 +18,6 @@ class DataView : public Object {
|
|||
public:
|
||||
static DataView* create(Realm&, ArrayBuffer*, size_t byte_length, size_t byte_offset);
|
||||
|
||||
explicit DataView(ArrayBuffer*, size_t byte_length, size_t byte_offset, Object& prototype);
|
||||
virtual ~DataView() override = default;
|
||||
|
||||
ArrayBuffer* viewed_array_buffer() const { return m_viewed_array_buffer; }
|
||||
|
@ -26,6 +25,8 @@ public:
|
|||
size_t byte_offset() const { return m_byte_offset; }
|
||||
|
||||
private:
|
||||
DataView(ArrayBuffer*, size_t byte_length, size_t byte_offset, Object& prototype);
|
||||
|
||||
virtual void visit_edges(Visitor& visitor) override;
|
||||
|
||||
ArrayBuffer* m_viewed_array_buffer { nullptr };
|
||||
|
|
|
@ -14,7 +14,6 @@ class DataViewConstructor final : public NativeFunction {
|
|||
JS_OBJECT(DataViewConstructor, NativeFunction);
|
||||
|
||||
public:
|
||||
explicit DataViewConstructor(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~DataViewConstructor() override = default;
|
||||
|
||||
|
@ -22,6 +21,8 @@ public:
|
|||
virtual ThrowCompletionOr<Object*> construct(FunctionObject&) override;
|
||||
|
||||
private:
|
||||
explicit DataViewConstructor(Realm&);
|
||||
|
||||
virtual bool has_constructor() const override { return true; }
|
||||
};
|
||||
|
||||
|
|
|
@ -15,11 +15,12 @@ class DataViewPrototype final : public PrototypeObject<DataViewPrototype, DataVi
|
|||
JS_PROTOTYPE_OBJECT(DataViewPrototype, DataView, DataView);
|
||||
|
||||
public:
|
||||
DataViewPrototype(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~DataViewPrototype() override = default;
|
||||
|
||||
private:
|
||||
explicit DataViewPrototype(Realm&);
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(get_big_int_64);
|
||||
JS_DECLARE_NATIVE_FUNCTION(get_big_uint_64);
|
||||
JS_DECLARE_NATIVE_FUNCTION(get_float_32);
|
||||
|
|
|
@ -18,7 +18,6 @@ public:
|
|||
static Date* create(Realm&, double date_value);
|
||||
static Date* now(VM&);
|
||||
|
||||
Date(double date_value, Object& prototype);
|
||||
virtual ~Date() override = default;
|
||||
|
||||
double date_value() const { return m_date_value; }
|
||||
|
@ -27,6 +26,8 @@ public:
|
|||
String iso_date_string() const;
|
||||
|
||||
private:
|
||||
Date(double date_value, Object& prototype);
|
||||
|
||||
double m_date_value { 0 }; // [[DateValue]]
|
||||
};
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@ class DateConstructor final : public NativeFunction {
|
|||
JS_OBJECT(DateConstructor, NativeFunction);
|
||||
|
||||
public:
|
||||
explicit DateConstructor(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~DateConstructor() override = default;
|
||||
|
||||
|
@ -22,6 +21,8 @@ public:
|
|||
virtual ThrowCompletionOr<Object*> construct(FunctionObject& new_target) override;
|
||||
|
||||
private:
|
||||
explicit DateConstructor(Realm&);
|
||||
|
||||
virtual bool has_constructor() const override { return true; }
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(now);
|
||||
|
|
|
@ -15,11 +15,12 @@ class DatePrototype final : public PrototypeObject<DatePrototype, Date> {
|
|||
JS_PROTOTYPE_OBJECT(DatePrototype, Date, Date);
|
||||
|
||||
public:
|
||||
explicit DatePrototype(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~DatePrototype() override = default;
|
||||
|
||||
private:
|
||||
explicit DatePrototype(Realm&);
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(get_date);
|
||||
JS_DECLARE_NATIVE_FUNCTION(get_day);
|
||||
JS_DECLARE_NATIVE_FUNCTION(get_full_year);
|
||||
|
|
|
@ -29,9 +29,6 @@ class DeclarativeEnvironment : public Environment {
|
|||
public:
|
||||
static DeclarativeEnvironment* create_for_per_iteration_bindings(Badge<ForStatement>, DeclarativeEnvironment& other, size_t bindings_size);
|
||||
|
||||
DeclarativeEnvironment();
|
||||
explicit DeclarativeEnvironment(Environment* parent_environment);
|
||||
explicit DeclarativeEnvironment(Environment* parent_environment, Span<Binding const> bindings);
|
||||
virtual ~DeclarativeEnvironment() override = default;
|
||||
|
||||
virtual ThrowCompletionOr<bool> has_binding(FlyString const& name, Optional<size_t>* = nullptr) const override;
|
||||
|
@ -62,6 +59,10 @@ public:
|
|||
ThrowCompletionOr<void> set_mutable_binding_direct(VM&, size_t index, Value, bool strict);
|
||||
|
||||
protected:
|
||||
DeclarativeEnvironment();
|
||||
explicit DeclarativeEnvironment(Environment* parent_environment);
|
||||
DeclarativeEnvironment(Environment* parent_environment, Span<Binding const> bindings);
|
||||
|
||||
virtual void visit_edges(Visitor&) override;
|
||||
|
||||
private:
|
||||
|
|
|
@ -35,7 +35,6 @@ public:
|
|||
static ECMAScriptFunctionObject* create(Realm&, FlyString name, String source_text, Statement const& ecmascript_code, Vector<FunctionNode::Parameter> parameters, i32 m_function_length, Environment* parent_environment, PrivateEnvironment* private_environment, FunctionKind, bool is_strict, bool might_need_arguments_object = true, bool contains_direct_call_to_eval = true, bool is_arrow_function = false, Variant<PropertyKey, PrivateName, Empty> class_field_initializer_name = {});
|
||||
static ECMAScriptFunctionObject* create(Realm&, FlyString name, Object& prototype, String source_text, Statement const& ecmascript_code, Vector<FunctionNode::Parameter> parameters, i32 m_function_length, Environment* parent_environment, PrivateEnvironment* private_environment, FunctionKind, bool is_strict, bool might_need_arguments_object = true, bool contains_direct_call_to_eval = true, bool is_arrow_function = false, Variant<PropertyKey, PrivateName, Empty> class_field_initializer_name = {});
|
||||
|
||||
ECMAScriptFunctionObject(FlyString name, String source_text, Statement const& ecmascript_code, Vector<FunctionNode::Parameter> parameters, i32 m_function_length, Environment* parent_environment, PrivateEnvironment* private_environment, Object& prototype, FunctionKind, bool is_strict, bool might_need_arguments_object, bool contains_direct_call_to_eval, bool is_arrow_function, Variant<PropertyKey, PrivateName, Empty> class_field_initializer_name);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~ECMAScriptFunctionObject() override = default;
|
||||
|
||||
|
@ -94,6 +93,8 @@ protected:
|
|||
virtual Completion ordinary_call_evaluate_body();
|
||||
|
||||
private:
|
||||
ECMAScriptFunctionObject(FlyString name, String source_text, Statement const& ecmascript_code, Vector<FunctionNode::Parameter> parameters, i32 m_function_length, Environment* parent_environment, PrivateEnvironment* private_environment, Object& prototype, FunctionKind, bool is_strict, bool might_need_arguments_object, bool contains_direct_call_to_eval, bool is_arrow_function, Variant<PropertyKey, PrivateName, Empty> class_field_initializer_name);
|
||||
|
||||
virtual bool is_ecmascript_function_object() const override { return true; }
|
||||
virtual void visit_edges(Visitor&) override;
|
||||
|
||||
|
|
|
@ -26,7 +26,6 @@ public:
|
|||
static Error* create(Realm&);
|
||||
static Error* create(Realm&, String const& message);
|
||||
|
||||
explicit Error(Object& prototype);
|
||||
virtual ~Error() override = default;
|
||||
|
||||
[[nodiscard]] String stack_string() const;
|
||||
|
@ -35,6 +34,9 @@ public:
|
|||
|
||||
Vector<TracebackFrame, 32> const& traceback() const { return m_traceback; }
|
||||
|
||||
protected:
|
||||
explicit Error(Object& prototype);
|
||||
|
||||
private:
|
||||
void populate_stack();
|
||||
Vector<TracebackFrame, 32> m_traceback;
|
||||
|
|
|
@ -15,7 +15,6 @@ class ErrorConstructor final : public NativeFunction {
|
|||
JS_OBJECT(ErrorConstructor, NativeFunction);
|
||||
|
||||
public:
|
||||
explicit ErrorConstructor(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~ErrorConstructor() override = default;
|
||||
|
||||
|
@ -23,6 +22,8 @@ public:
|
|||
virtual ThrowCompletionOr<Object*> construct(FunctionObject& new_target) override;
|
||||
|
||||
private:
|
||||
explicit ErrorConstructor(Realm&);
|
||||
|
||||
virtual bool has_constructor() const override { return true; }
|
||||
};
|
||||
|
||||
|
@ -31,14 +32,18 @@ private:
|
|||
JS_OBJECT(ConstructorName, NativeFunction); \
|
||||
\
|
||||
public: \
|
||||
explicit ConstructorName(Realm&); \
|
||||
virtual void initialize(Realm&) override; \
|
||||
virtual ~ConstructorName() override; \
|
||||
virtual ThrowCompletionOr<Value> call() override; \
|
||||
virtual ThrowCompletionOr<Object*> construct(FunctionObject& new_target) override; \
|
||||
\
|
||||
private: \
|
||||
virtual bool has_constructor() const override { return true; } \
|
||||
explicit ConstructorName(Realm&); \
|
||||
\
|
||||
virtual bool has_constructor() const override \
|
||||
{ \
|
||||
return true; \
|
||||
} \
|
||||
};
|
||||
|
||||
#define __JS_ENUMERATE(ClassName, snake_name, PrototypeName, ConstructorName, ArrayType) \
|
||||
|
|
|
@ -16,11 +16,12 @@ class ErrorPrototype final : public PrototypeObject<ErrorPrototype, Error> {
|
|||
JS_PROTOTYPE_OBJECT(ErrorPrototype, Error, Error);
|
||||
|
||||
public:
|
||||
explicit ErrorPrototype(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~ErrorPrototype() override = default;
|
||||
|
||||
private:
|
||||
explicit ErrorPrototype(Realm&);
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(to_string);
|
||||
JS_DECLARE_NATIVE_FUNCTION(stack_getter);
|
||||
JS_DECLARE_NATIVE_FUNCTION(stack_setter);
|
||||
|
@ -31,9 +32,11 @@ private:
|
|||
JS_PROTOTYPE_OBJECT(PrototypeName, ClassName, ClassName); \
|
||||
\
|
||||
public: \
|
||||
explicit PrototypeName(Realm&); \
|
||||
virtual void initialize(Realm&) override; \
|
||||
virtual ~PrototypeName() override = default; \
|
||||
\
|
||||
private: \
|
||||
explicit PrototypeName(Realm&); \
|
||||
};
|
||||
|
||||
#define __JS_ENUMERATE(ClassName, snake_name, PrototypeName, ConstructorName, ArrayType) \
|
||||
|
|
|
@ -22,7 +22,6 @@ class FinalizationRegistry final
|
|||
JS_OBJECT(FinalizationRegistry, Object);
|
||||
|
||||
public:
|
||||
explicit FinalizationRegistry(Realm&, JobCallback, Object& prototype);
|
||||
virtual ~FinalizationRegistry() override = default;
|
||||
|
||||
void add_finalization_record(Cell& target, Value held_value, Cell* unregister_token);
|
||||
|
@ -38,6 +37,8 @@ public:
|
|||
JobCallback const& cleanup_callback() const { return m_cleanup_callback; }
|
||||
|
||||
private:
|
||||
FinalizationRegistry(Realm&, JobCallback, Object& prototype);
|
||||
|
||||
virtual void visit_edges(Visitor& visitor) override;
|
||||
|
||||
Handle<Realm> m_realm;
|
||||
|
|
|
@ -14,7 +14,6 @@ class FinalizationRegistryConstructor final : public NativeFunction {
|
|||
JS_OBJECT(FinalizationRegistryConstructor, NativeFunction);
|
||||
|
||||
public:
|
||||
explicit FinalizationRegistryConstructor(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~FinalizationRegistryConstructor() override = default;
|
||||
|
||||
|
@ -22,6 +21,8 @@ public:
|
|||
virtual ThrowCompletionOr<Object*> construct(FunctionObject&) override;
|
||||
|
||||
private:
|
||||
explicit FinalizationRegistryConstructor(Realm&);
|
||||
|
||||
virtual bool has_constructor() const override { return true; }
|
||||
};
|
||||
|
||||
|
|
|
@ -15,11 +15,12 @@ class FinalizationRegistryPrototype final : public PrototypeObject<FinalizationR
|
|||
JS_PROTOTYPE_OBJECT(FinalizationRegistryPrototype, FinalizationRegistry, FinalizationRegistry);
|
||||
|
||||
public:
|
||||
FinalizationRegistryPrototype(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~FinalizationRegistryPrototype() override = default;
|
||||
|
||||
private:
|
||||
explicit FinalizationRegistryPrototype(Realm&);
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(cleanup_some);
|
||||
JS_DECLARE_NATIVE_FUNCTION(register_);
|
||||
JS_DECLARE_NATIVE_FUNCTION(unregister);
|
||||
|
|
|
@ -17,7 +17,6 @@ class FunctionConstructor final : public NativeFunction {
|
|||
public:
|
||||
static ThrowCompletionOr<ECMAScriptFunctionObject*> create_dynamic_function(VM&, FunctionObject& constructor, FunctionObject* new_target, FunctionKind kind, MarkedVector<Value> const& args);
|
||||
|
||||
explicit FunctionConstructor(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~FunctionConstructor() override = default;
|
||||
|
||||
|
@ -25,6 +24,8 @@ public:
|
|||
virtual ThrowCompletionOr<Object*> construct(FunctionObject& new_target) override;
|
||||
|
||||
private:
|
||||
explicit FunctionConstructor(Realm&);
|
||||
|
||||
virtual bool has_constructor() const override { return true; }
|
||||
};
|
||||
|
||||
|
|
|
@ -22,7 +22,6 @@ public:
|
|||
Uninitialized,
|
||||
};
|
||||
|
||||
explicit FunctionEnvironment(Environment* parent_environment);
|
||||
virtual ~FunctionEnvironment() override = default;
|
||||
|
||||
ThisBindingStatus this_binding_status() const { return m_this_binding_status; }
|
||||
|
@ -47,6 +46,8 @@ public:
|
|||
ThrowCompletionOr<Value> bind_this_value(VM&, Value);
|
||||
|
||||
private:
|
||||
explicit FunctionEnvironment(Environment* parent_environment);
|
||||
|
||||
virtual bool is_function_environment() const override { return true; }
|
||||
virtual void visit_edges(Visitor&) override;
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@ class FunctionPrototype final : public FunctionObject {
|
|||
JS_OBJECT(FunctionPrototype, FunctionObject);
|
||||
|
||||
public:
|
||||
explicit FunctionPrototype(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~FunctionPrototype() override = default;
|
||||
|
||||
|
@ -22,6 +21,8 @@ public:
|
|||
virtual FlyString const& name() const override { return m_name; }
|
||||
|
||||
private:
|
||||
explicit FunctionPrototype(Realm&);
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(apply);
|
||||
JS_DECLARE_NATIVE_FUNCTION(bind);
|
||||
JS_DECLARE_NATIVE_FUNCTION(call);
|
||||
|
|
|
@ -15,7 +15,6 @@ class GeneratorFunctionConstructor final : public NativeFunction {
|
|||
JS_OBJECT(GeneratorFunctionConstructor, NativeFunction);
|
||||
|
||||
public:
|
||||
explicit GeneratorFunctionConstructor(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~GeneratorFunctionConstructor() override = default;
|
||||
|
||||
|
@ -23,6 +22,8 @@ public:
|
|||
virtual ThrowCompletionOr<Object*> construct(FunctionObject& new_target) override;
|
||||
|
||||
private:
|
||||
explicit GeneratorFunctionConstructor(Realm&);
|
||||
|
||||
bool has_constructor() const override { return true; }
|
||||
};
|
||||
|
||||
|
|
|
@ -16,9 +16,11 @@ class GeneratorFunctionPrototype final : public Object {
|
|||
JS_OBJECT(GeneratorFunctionPrototype, Object);
|
||||
|
||||
public:
|
||||
explicit GeneratorFunctionPrototype(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~GeneratorFunctionPrototype() override = default;
|
||||
|
||||
private:
|
||||
explicit GeneratorFunctionPrototype(Realm&);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -17,7 +17,6 @@ class GeneratorObject final : public Object {
|
|||
|
||||
public:
|
||||
static ThrowCompletionOr<GeneratorObject*> create(Realm&, Value, ECMAScriptFunctionObject*, ExecutionContext, Bytecode::RegisterWindow);
|
||||
GeneratorObject(Realm&, Object& prototype, ExecutionContext);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~GeneratorObject() override = default;
|
||||
void visit_edges(Cell::Visitor&) override;
|
||||
|
@ -26,6 +25,8 @@ public:
|
|||
void set_done() { m_done = true; }
|
||||
|
||||
private:
|
||||
GeneratorObject(Realm&, Object& prototype, ExecutionContext);
|
||||
|
||||
ExecutionContext m_execution_context;
|
||||
ECMAScriptFunctionObject* m_generating_function { nullptr };
|
||||
Value m_previous_value;
|
||||
|
|
|
@ -16,11 +16,12 @@ class GeneratorPrototype final : public PrototypeObject<GeneratorPrototype, Gene
|
|||
JS_PROTOTYPE_OBJECT(GeneratorPrototype, GeneratorObject, Generator);
|
||||
|
||||
public:
|
||||
explicit GeneratorPrototype(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~GeneratorPrototype() override = default;
|
||||
|
||||
private:
|
||||
explicit GeneratorPrototype(Realm&);
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(next);
|
||||
JS_DECLARE_NATIVE_FUNCTION(return_);
|
||||
JS_DECLARE_NATIVE_FUNCTION(throw_);
|
||||
|
|
|
@ -14,8 +14,6 @@ class GlobalEnvironment final : public Environment {
|
|||
JS_ENVIRONMENT(GlobalEnvironment, Environment);
|
||||
|
||||
public:
|
||||
GlobalEnvironment(Object&, Object& this_value);
|
||||
|
||||
virtual bool has_this_binding() const final { return true; }
|
||||
virtual ThrowCompletionOr<Value> get_this_binding(VM&) const final;
|
||||
|
||||
|
@ -40,6 +38,8 @@ public:
|
|||
ThrowCompletionOr<void> create_global_function_binding(FlyString const& name, Value, bool can_be_deleted);
|
||||
|
||||
private:
|
||||
GlobalEnvironment(Object&, Object& this_value);
|
||||
|
||||
virtual bool is_global_environment() const override { return true; }
|
||||
virtual void visit_edges(Visitor&) override;
|
||||
|
||||
|
|
|
@ -19,10 +19,12 @@ class GlobalObject : public Object {
|
|||
friend class Intrinsics;
|
||||
|
||||
public:
|
||||
explicit GlobalObject(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~GlobalObject() override;
|
||||
|
||||
protected:
|
||||
explicit GlobalObject(Realm&);
|
||||
|
||||
private:
|
||||
virtual bool is_global_object() const final { return true; }
|
||||
|
||||
|
|
|
@ -43,7 +43,6 @@ public:
|
|||
return AK::Array { "co"sv, "kf"sv, "kn"sv };
|
||||
}
|
||||
|
||||
explicit Collator(Object& prototype);
|
||||
virtual ~Collator() override = default;
|
||||
|
||||
String const& locale() const { return m_locale; }
|
||||
|
@ -74,6 +73,8 @@ public:
|
|||
void set_bound_compare(CollatorCompareFunction* bound_compare) { m_bound_compare = bound_compare; }
|
||||
|
||||
private:
|
||||
explicit Collator(Object& prototype);
|
||||
|
||||
virtual void visit_edges(Visitor&) override;
|
||||
|
||||
String m_locale; // [[Locale]]
|
||||
|
|
|
@ -16,13 +16,14 @@ class CollatorCompareFunction : public NativeFunction {
|
|||
public:
|
||||
static CollatorCompareFunction* create(Realm&, Collator&);
|
||||
|
||||
CollatorCompareFunction(Realm&, Collator&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~CollatorCompareFunction() override = default;
|
||||
|
||||
virtual ThrowCompletionOr<Value> call() override;
|
||||
|
||||
private:
|
||||
CollatorCompareFunction(Realm&, Collator&);
|
||||
|
||||
virtual void visit_edges(Visitor&) override;
|
||||
|
||||
Collator& m_collator; // [[Collator]]
|
||||
|
|
|
@ -14,7 +14,6 @@ class CollatorConstructor final : public NativeFunction {
|
|||
JS_OBJECT(CollatorConstructor, NativeFunction);
|
||||
|
||||
public:
|
||||
explicit CollatorConstructor(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~CollatorConstructor() override = default;
|
||||
|
||||
|
@ -22,6 +21,8 @@ public:
|
|||
virtual ThrowCompletionOr<Object*> construct(FunctionObject& new_target) override;
|
||||
|
||||
private:
|
||||
explicit CollatorConstructor(Realm&);
|
||||
|
||||
virtual bool has_constructor() const override { return true; }
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(supported_locales_of);
|
||||
|
|
|
@ -15,11 +15,12 @@ class CollatorPrototype final : public PrototypeObject<CollatorPrototype, Collat
|
|||
JS_PROTOTYPE_OBJECT(CollatorPrototype, Collator, Collator);
|
||||
|
||||
public:
|
||||
explicit CollatorPrototype(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~CollatorPrototype() override = default;
|
||||
|
||||
private:
|
||||
explicit CollatorPrototype(Realm&);
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(compare_getter);
|
||||
JS_DECLARE_NATIVE_FUNCTION(resolved_options);
|
||||
};
|
||||
|
|
|
@ -41,7 +41,6 @@ public:
|
|||
return AK::Array { "ca"sv, "hc"sv, "nu"sv };
|
||||
}
|
||||
|
||||
DateTimeFormat(Object& prototype);
|
||||
virtual ~DateTimeFormat() override = default;
|
||||
|
||||
String const& locale() const { return m_locale; }
|
||||
|
@ -128,6 +127,8 @@ public:
|
|||
void set_bound_format(NativeFunction* bound_format) { m_bound_format = bound_format; }
|
||||
|
||||
private:
|
||||
DateTimeFormat(Object& prototype);
|
||||
|
||||
static Style style_from_string(StringView style);
|
||||
static StringView style_to_string(Style style);
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@ class DateTimeFormatConstructor final : public NativeFunction {
|
|||
JS_OBJECT(DateTimeFormatConstructor, NativeFunction);
|
||||
|
||||
public:
|
||||
explicit DateTimeFormatConstructor(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~DateTimeFormatConstructor() override = default;
|
||||
|
||||
|
@ -22,6 +21,8 @@ public:
|
|||
virtual ThrowCompletionOr<Object*> construct(FunctionObject& new_target) override;
|
||||
|
||||
private:
|
||||
explicit DateTimeFormatConstructor(Realm&);
|
||||
|
||||
virtual bool has_constructor() const override { return true; }
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(supported_locales_of);
|
||||
|
|
|
@ -18,13 +18,14 @@ class DateTimeFormatFunction final : public NativeFunction {
|
|||
public:
|
||||
static DateTimeFormatFunction* create(Realm&, DateTimeFormat&);
|
||||
|
||||
explicit DateTimeFormatFunction(DateTimeFormat&, Object& prototype);
|
||||
virtual ~DateTimeFormatFunction() override = default;
|
||||
virtual void initialize(Realm&) override;
|
||||
|
||||
virtual ThrowCompletionOr<Value> call() override;
|
||||
|
||||
private:
|
||||
explicit DateTimeFormatFunction(DateTimeFormat&, Object& prototype);
|
||||
|
||||
virtual void visit_edges(Visitor&) override;
|
||||
|
||||
DateTimeFormat& m_date_time_format; // [[DateTimeFormat]]
|
||||
|
|
|
@ -15,11 +15,12 @@ class DateTimeFormatPrototype final : public PrototypeObject<DateTimeFormatProto
|
|||
JS_PROTOTYPE_OBJECT(DateTimeFormatPrototype, DateTimeFormat, Intl.DateTimeFormat);
|
||||
|
||||
public:
|
||||
explicit DateTimeFormatPrototype(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~DateTimeFormatPrototype() override = default;
|
||||
|
||||
private:
|
||||
explicit DateTimeFormatPrototype(Realm&);
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(format);
|
||||
JS_DECLARE_NATIVE_FUNCTION(format_to_parts);
|
||||
JS_DECLARE_NATIVE_FUNCTION(format_range);
|
||||
|
|
|
@ -39,7 +39,6 @@ class DisplayNames final : public Object {
|
|||
};
|
||||
|
||||
public:
|
||||
DisplayNames(Object& prototype);
|
||||
virtual ~DisplayNames() override = default;
|
||||
|
||||
String const& locale() const { return m_locale; }
|
||||
|
@ -63,6 +62,8 @@ public:
|
|||
StringView language_display_string() const;
|
||||
|
||||
private:
|
||||
DisplayNames(Object& prototype);
|
||||
|
||||
String m_locale; // [[Locale]]
|
||||
Unicode::Style m_style { Unicode::Style::Long }; // [[Style]]
|
||||
Type m_type { Type::Invalid }; // [[Type]]
|
||||
|
|
|
@ -14,7 +14,6 @@ class DisplayNamesConstructor final : public NativeFunction {
|
|||
JS_OBJECT(DisplayNamesConstructor, NativeFunction);
|
||||
|
||||
public:
|
||||
explicit DisplayNamesConstructor(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~DisplayNamesConstructor() override = default;
|
||||
|
||||
|
@ -22,6 +21,8 @@ public:
|
|||
virtual ThrowCompletionOr<Object*> construct(FunctionObject& new_target) override;
|
||||
|
||||
private:
|
||||
explicit DisplayNamesConstructor(Realm&);
|
||||
|
||||
virtual bool has_constructor() const override { return true; }
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(supported_locales_of);
|
||||
|
|
|
@ -15,11 +15,12 @@ class DisplayNamesPrototype final : public PrototypeObject<DisplayNamesPrototype
|
|||
JS_PROTOTYPE_OBJECT(DisplayNamesPrototype, DisplayNames, Intl.DisplayNames);
|
||||
|
||||
public:
|
||||
explicit DisplayNamesPrototype(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~DisplayNamesPrototype() override = default;
|
||||
|
||||
private:
|
||||
explicit DisplayNamesPrototype(Realm&);
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(of);
|
||||
JS_DECLARE_NATIVE_FUNCTION(resolved_options);
|
||||
};
|
||||
|
|
|
@ -48,7 +48,6 @@ public:
|
|||
return AK::Array { "nu"sv };
|
||||
}
|
||||
|
||||
explicit DurationFormat(Object& prototype);
|
||||
virtual ~DurationFormat() override = default;
|
||||
|
||||
void set_locale(String locale) { m_locale = move(locale); }
|
||||
|
@ -148,6 +147,8 @@ public:
|
|||
u8 fractional_digits() const { return m_fractional_digits.value(); }
|
||||
|
||||
private:
|
||||
explicit DurationFormat(Object& prototype);
|
||||
|
||||
static Style style_from_string(StringView style);
|
||||
static StringView style_to_string(Style);
|
||||
static ValueStyle date_style_from_string(StringView date_style);
|
||||
|
|
|
@ -14,7 +14,6 @@ class DurationFormatConstructor final : public NativeFunction {
|
|||
JS_OBJECT(DurationFormatConstructor, NativeFunction);
|
||||
|
||||
public:
|
||||
explicit DurationFormatConstructor(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~DurationFormatConstructor() override = default;
|
||||
|
||||
|
@ -22,6 +21,8 @@ public:
|
|||
virtual ThrowCompletionOr<Object*> construct(FunctionObject& new_target) override;
|
||||
|
||||
private:
|
||||
explicit DurationFormatConstructor(Realm&);
|
||||
|
||||
virtual bool has_constructor() const override { return true; }
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(supported_locales_of);
|
||||
|
|
|
@ -15,11 +15,12 @@ class DurationFormatPrototype final : public PrototypeObject<DurationFormatProto
|
|||
JS_PROTOTYPE_OBJECT(DurationFormatPrototype, DurationFormat, Intl.DurationFormat);
|
||||
|
||||
public:
|
||||
explicit DurationFormatPrototype(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~DurationFormatPrototype() override = default;
|
||||
|
||||
private:
|
||||
explicit DurationFormatPrototype(Realm&);
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(format);
|
||||
JS_DECLARE_NATIVE_FUNCTION(format_to_parts);
|
||||
JS_DECLARE_NATIVE_FUNCTION(resolved_options);
|
||||
|
|
|
@ -14,11 +14,12 @@ class Intl final : public Object {
|
|||
JS_OBJECT(Intl, Object);
|
||||
|
||||
public:
|
||||
explicit Intl(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~Intl() override = default;
|
||||
|
||||
private:
|
||||
explicit Intl(Realm&);
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(get_canonical_locales);
|
||||
JS_DECLARE_NATIVE_FUNCTION(supported_values_of);
|
||||
};
|
||||
|
|
|
@ -28,7 +28,6 @@ public:
|
|||
Unit,
|
||||
};
|
||||
|
||||
ListFormat(Object& prototype);
|
||||
virtual ~ListFormat() override = default;
|
||||
|
||||
String const& locale() const { return m_locale; }
|
||||
|
@ -43,6 +42,8 @@ public:
|
|||
StringView style_string() const { return Unicode::style_to_string(m_style); }
|
||||
|
||||
private:
|
||||
explicit ListFormat(Object& prototype);
|
||||
|
||||
String m_locale; // [[Locale]]
|
||||
Type m_type { Type::Invalid }; // [[Type]]
|
||||
Unicode::Style m_style { Unicode::Style::Long }; // [[Style]]
|
||||
|
|
|
@ -14,7 +14,6 @@ class ListFormatConstructor final : public NativeFunction {
|
|||
JS_OBJECT(ListFormatConstructor, NativeFunction);
|
||||
|
||||
public:
|
||||
explicit ListFormatConstructor(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~ListFormatConstructor() override = default;
|
||||
|
||||
|
@ -22,6 +21,8 @@ public:
|
|||
virtual ThrowCompletionOr<Object*> construct(FunctionObject& new_target) override;
|
||||
|
||||
private:
|
||||
explicit ListFormatConstructor(Realm&);
|
||||
|
||||
virtual bool has_constructor() const override { return true; }
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(supported_locales_of);
|
||||
|
|
|
@ -15,11 +15,12 @@ class ListFormatPrototype final : public PrototypeObject<ListFormatPrototype, Li
|
|||
JS_PROTOTYPE_OBJECT(ListFormatPrototype, ListFormat, Intl.ListFormat);
|
||||
|
||||
public:
|
||||
explicit ListFormatPrototype(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~ListFormatPrototype() override = default;
|
||||
|
||||
private:
|
||||
explicit ListFormatPrototype(Realm&);
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(format);
|
||||
JS_DECLARE_NATIVE_FUNCTION(format_to_parts);
|
||||
JS_DECLARE_NATIVE_FUNCTION(resolved_options);
|
||||
|
|
|
@ -34,8 +34,6 @@ public:
|
|||
return AK::Array { "ca"sv, "co"sv, "hc"sv, "kf"sv, "kn"sv, "nu"sv };
|
||||
}
|
||||
|
||||
Locale(Object& prototype);
|
||||
Locale(Unicode::LocaleID const&, Object& prototype);
|
||||
virtual ~Locale() override = default;
|
||||
|
||||
String const& locale() const { return m_locale; }
|
||||
|
@ -65,6 +63,9 @@ public:
|
|||
void set_numeric(bool numeric) { m_numeric = numeric; }
|
||||
|
||||
private:
|
||||
explicit Locale(Object& prototype);
|
||||
Locale(Unicode::LocaleID const&, Object& prototype);
|
||||
|
||||
String m_locale; // [[Locale]]
|
||||
Optional<String> m_calendar; // [[Calendar]]
|
||||
Optional<String> m_case_first; // [[CaseFirst]]
|
||||
|
|
|
@ -14,7 +14,6 @@ class LocaleConstructor final : public NativeFunction {
|
|||
JS_OBJECT(LocaleConstructor, NativeFunction);
|
||||
|
||||
public:
|
||||
explicit LocaleConstructor(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~LocaleConstructor() override = default;
|
||||
|
||||
|
@ -22,6 +21,8 @@ public:
|
|||
virtual ThrowCompletionOr<Object*> construct(FunctionObject& new_target) override;
|
||||
|
||||
private:
|
||||
explicit LocaleConstructor(Realm&);
|
||||
|
||||
virtual bool has_constructor() const override { return true; }
|
||||
};
|
||||
|
||||
|
|
|
@ -15,11 +15,12 @@ class LocalePrototype final : public PrototypeObject<LocalePrototype, Locale> {
|
|||
JS_PROTOTYPE_OBJECT(LocalePrototype, Locale, Intl.Locale);
|
||||
|
||||
public:
|
||||
explicit LocalePrototype(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~LocalePrototype() override = default;
|
||||
|
||||
private:
|
||||
explicit LocalePrototype(Realm&);
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(maximize);
|
||||
JS_DECLARE_NATIVE_FUNCTION(minimize);
|
||||
JS_DECLARE_NATIVE_FUNCTION(to_string);
|
||||
|
|
|
@ -56,7 +56,6 @@ public:
|
|||
StripIfInteger,
|
||||
};
|
||||
|
||||
NumberFormatBase(Object& prototype);
|
||||
virtual ~NumberFormatBase() override = default;
|
||||
|
||||
String const& locale() const { return m_locale; }
|
||||
|
@ -99,6 +98,9 @@ public:
|
|||
StringView trailing_zero_display_string() const;
|
||||
void set_trailing_zero_display(StringView trailing_zero_display);
|
||||
|
||||
protected:
|
||||
explicit NumberFormatBase(Object& prototype);
|
||||
|
||||
private:
|
||||
String m_locale; // [[Locale]]
|
||||
String m_data_locale; // [[DataLocale]]
|
||||
|
@ -174,7 +176,6 @@ public:
|
|||
return AK::Array { "nu"sv };
|
||||
}
|
||||
|
||||
NumberFormat(Object& prototype);
|
||||
virtual ~NumberFormat() override = default;
|
||||
|
||||
String const& numbering_system() const { return m_numbering_system; }
|
||||
|
@ -233,6 +234,8 @@ public:
|
|||
Unicode::NumberFormat compact_format() const { return *m_compact_format; }
|
||||
|
||||
private:
|
||||
explicit NumberFormat(Object& prototype);
|
||||
|
||||
virtual void visit_edges(Visitor&) override;
|
||||
|
||||
String m_locale; // [[Locale]]
|
||||
|
|
|
@ -15,7 +15,6 @@ class NumberFormatConstructor final : public NativeFunction {
|
|||
JS_OBJECT(NumberFormatConstructor, NativeFunction);
|
||||
|
||||
public:
|
||||
explicit NumberFormatConstructor(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~NumberFormatConstructor() override = default;
|
||||
|
||||
|
@ -23,6 +22,8 @@ public:
|
|||
virtual ThrowCompletionOr<Object*> construct(FunctionObject& new_target) override;
|
||||
|
||||
private:
|
||||
explicit NumberFormatConstructor(Realm&);
|
||||
|
||||
virtual bool has_constructor() const override { return true; }
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(supported_locales_of);
|
||||
|
|
|
@ -18,13 +18,14 @@ class NumberFormatFunction final : public NativeFunction {
|
|||
public:
|
||||
static NumberFormatFunction* create(Realm&, NumberFormat&);
|
||||
|
||||
explicit NumberFormatFunction(NumberFormat&, Object& prototype);
|
||||
virtual ~NumberFormatFunction() override = default;
|
||||
virtual void initialize(Realm&) override;
|
||||
|
||||
virtual ThrowCompletionOr<Value> call() override;
|
||||
|
||||
private:
|
||||
explicit NumberFormatFunction(NumberFormat&, Object& prototype);
|
||||
|
||||
virtual void visit_edges(Visitor&) override;
|
||||
|
||||
NumberFormat& m_number_format; // [[NumberFormat]]
|
||||
|
|
|
@ -15,11 +15,12 @@ class NumberFormatPrototype final : public PrototypeObject<NumberFormatPrototype
|
|||
JS_PROTOTYPE_OBJECT(NumberFormatPrototype, NumberFormat, Intl.NumberFormat);
|
||||
|
||||
public:
|
||||
explicit NumberFormatPrototype(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~NumberFormatPrototype() override = default;
|
||||
|
||||
private:
|
||||
explicit NumberFormatPrototype(Realm&);
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(format);
|
||||
JS_DECLARE_NATIVE_FUNCTION(format_to_parts);
|
||||
JS_DECLARE_NATIVE_FUNCTION(format_range);
|
||||
|
|
|
@ -19,7 +19,6 @@ class PluralRules final : public NumberFormatBase {
|
|||
JS_OBJECT(PluralRules, NumberFormatBase);
|
||||
|
||||
public:
|
||||
PluralRules(Object& prototype);
|
||||
virtual ~PluralRules() override = default;
|
||||
|
||||
Unicode::PluralForm type() const { return m_type; }
|
||||
|
@ -27,6 +26,8 @@ public:
|
|||
void set_type(StringView type) { m_type = Unicode::plural_form_from_string(type); }
|
||||
|
||||
private:
|
||||
explicit PluralRules(Object& prototype);
|
||||
|
||||
Unicode::PluralForm m_type { Unicode::PluralForm::Cardinal }; // [[Type]]
|
||||
};
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@ class PluralRulesConstructor final : public NativeFunction {
|
|||
JS_OBJECT(PluralRulesConstructor, NativeFunction);
|
||||
|
||||
public:
|
||||
explicit PluralRulesConstructor(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~PluralRulesConstructor() override = default;
|
||||
|
||||
|
@ -22,6 +21,8 @@ public:
|
|||
virtual ThrowCompletionOr<Object*> construct(FunctionObject& new_target) override;
|
||||
|
||||
private:
|
||||
explicit PluralRulesConstructor(Realm&);
|
||||
|
||||
virtual bool has_constructor() const override { return true; }
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(supported_locales_of);
|
||||
|
|
|
@ -15,11 +15,12 @@ class PluralRulesPrototype final : public PrototypeObject<PluralRulesPrototype,
|
|||
JS_PROTOTYPE_OBJECT(PluralRulesPrototype, PluralRules, Intl.PluralRules);
|
||||
|
||||
public:
|
||||
explicit PluralRulesPrototype(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~PluralRulesPrototype() override = default;
|
||||
|
||||
private:
|
||||
explicit PluralRulesPrototype(Realm&);
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(select);
|
||||
JS_DECLARE_NATIVE_FUNCTION(select_range);
|
||||
JS_DECLARE_NATIVE_FUNCTION(resolved_options);
|
||||
|
|
|
@ -33,7 +33,6 @@ public:
|
|||
return AK::Array { "nu"sv };
|
||||
}
|
||||
|
||||
RelativeTimeFormat(Object& prototype);
|
||||
virtual ~RelativeTimeFormat() override = default;
|
||||
|
||||
String const& locale() const { return m_locale; }
|
||||
|
@ -60,6 +59,8 @@ public:
|
|||
void set_plural_rules(PluralRules* plural_rules) { m_plural_rules = plural_rules; }
|
||||
|
||||
private:
|
||||
explicit RelativeTimeFormat(Object& prototype);
|
||||
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
String m_locale; // [[Locale]]
|
||||
|
|
|
@ -14,7 +14,6 @@ class RelativeTimeFormatConstructor final : public NativeFunction {
|
|||
JS_OBJECT(RelativeTimeFormatConstructor, NativeFunction);
|
||||
|
||||
public:
|
||||
explicit RelativeTimeFormatConstructor(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~RelativeTimeFormatConstructor() override = default;
|
||||
|
||||
|
@ -22,6 +21,8 @@ public:
|
|||
virtual ThrowCompletionOr<Object*> construct(FunctionObject& new_target) override;
|
||||
|
||||
private:
|
||||
explicit RelativeTimeFormatConstructor(Realm&);
|
||||
|
||||
virtual bool has_constructor() const override { return true; }
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(supported_locales_of);
|
||||
|
|
|
@ -15,11 +15,12 @@ class RelativeTimeFormatPrototype final : public PrototypeObject<RelativeTimeFor
|
|||
JS_PROTOTYPE_OBJECT(RelativeTimeFormatPrototype, RelativeTimeFormat, Intl.RelativeTimeFormat);
|
||||
|
||||
public:
|
||||
explicit RelativeTimeFormatPrototype(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~RelativeTimeFormatPrototype() override = default;
|
||||
|
||||
private:
|
||||
explicit RelativeTimeFormatPrototype(Realm&);
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(format);
|
||||
JS_DECLARE_NATIVE_FUNCTION(format_to_parts);
|
||||
JS_DECLARE_NATIVE_FUNCTION(resolved_options);
|
||||
|
|
|
@ -18,7 +18,6 @@ class SegmentIterator final : public Object {
|
|||
public:
|
||||
static SegmentIterator* create(Realm&, Segmenter&, Utf16View const&, Segments const&);
|
||||
|
||||
SegmentIterator(Realm&, Segmenter&, Utf16View const&, Segments const&);
|
||||
virtual ~SegmentIterator() override = default;
|
||||
|
||||
Segmenter const& iterating_segmenter() const { return m_iterating_segmenter; }
|
||||
|
@ -29,6 +28,8 @@ public:
|
|||
Segments const& segments() { return m_segments; }
|
||||
|
||||
private:
|
||||
SegmentIterator(Realm&, Segmenter&, Utf16View const&, Segments const&);
|
||||
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
Segmenter& m_iterating_segmenter; // [[IteratingSegmenter]]
|
||||
|
|
|
@ -15,11 +15,12 @@ class SegmentIteratorPrototype final : public PrototypeObject<SegmentIteratorPro
|
|||
JS_PROTOTYPE_OBJECT(SegmentIteratorPrototype, SegmentIterator, SegmentIterator);
|
||||
|
||||
public:
|
||||
explicit SegmentIteratorPrototype(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~SegmentIteratorPrototype() override = default;
|
||||
|
||||
private:
|
||||
explicit SegmentIteratorPrototype(Realm&);
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(next);
|
||||
};
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@ public:
|
|||
Sentence,
|
||||
};
|
||||
|
||||
explicit Segmenter(Object& prototype);
|
||||
virtual ~Segmenter() override = default;
|
||||
|
||||
String const& locale() const { return m_locale; }
|
||||
|
@ -32,6 +31,8 @@ public:
|
|||
StringView segmenter_granularity_string() const;
|
||||
|
||||
private:
|
||||
explicit Segmenter(Object& prototype);
|
||||
|
||||
String m_locale; // [[Locale]]
|
||||
SegmenterGranularity m_segmenter_granularity { SegmenterGranularity::Grapheme }; // [[SegmenterGranularity]]
|
||||
};
|
||||
|
|
|
@ -14,7 +14,6 @@ class SegmenterConstructor final : public NativeFunction {
|
|||
JS_OBJECT(SegmenterConstructor, NativeFunction);
|
||||
|
||||
public:
|
||||
explicit SegmenterConstructor(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~SegmenterConstructor() override = default;
|
||||
|
||||
|
@ -22,6 +21,8 @@ public:
|
|||
virtual ThrowCompletionOr<Object*> construct(FunctionObject& new_target) override;
|
||||
|
||||
private:
|
||||
explicit SegmenterConstructor(Realm&);
|
||||
|
||||
virtual bool has_constructor() const override { return true; }
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(supported_locales_of);
|
||||
|
|
|
@ -15,11 +15,12 @@ class SegmenterPrototype final : public PrototypeObject<SegmenterPrototype, Segm
|
|||
JS_PROTOTYPE_OBJECT(SegmenterPrototype, Segmenter, Segmenter);
|
||||
|
||||
public:
|
||||
explicit SegmenterPrototype(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~SegmenterPrototype() override = default;
|
||||
|
||||
private:
|
||||
explicit SegmenterPrototype(Realm&);
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(segment);
|
||||
JS_DECLARE_NATIVE_FUNCTION(resolved_options);
|
||||
};
|
||||
|
|
|
@ -18,7 +18,6 @@ class Segments final : public Object {
|
|||
public:
|
||||
static Segments* create(Realm&, Segmenter&, Utf16String);
|
||||
|
||||
Segments(Realm&, Segmenter&, Utf16String);
|
||||
virtual ~Segments() override = default;
|
||||
|
||||
Segmenter& segments_segmenter() const { return m_segments_segmenter; }
|
||||
|
@ -28,6 +27,8 @@ public:
|
|||
Optional<Vector<size_t>>& boundaries_cache() const { return m_boundaries_cache; }
|
||||
|
||||
private:
|
||||
Segments(Realm&, Segmenter&, Utf16String);
|
||||
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
Segmenter& m_segments_segmenter; // [[SegmentsSegmenter]]
|
||||
|
|
|
@ -15,11 +15,12 @@ class SegmentsPrototype final : public PrototypeObject<SegmentsPrototype, Segmen
|
|||
JS_PROTOTYPE_OBJECT(SegmentsPrototype, Segments, Segments);
|
||||
|
||||
public:
|
||||
explicit SegmentsPrototype(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~SegmentsPrototype() override = default;
|
||||
|
||||
private:
|
||||
explicit SegmentsPrototype(Realm&);
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(containing);
|
||||
JS_DECLARE_NATIVE_FUNCTION(symbol_iterator);
|
||||
};
|
||||
|
|
|
@ -18,8 +18,6 @@ class Intrinsics final : public Cell {
|
|||
public:
|
||||
static Intrinsics* create(Realm&);
|
||||
|
||||
Intrinsics() = default;
|
||||
|
||||
Shape* empty_object_shape() { return m_empty_object_shape; }
|
||||
|
||||
Shape* new_object_shape() { return m_new_object_shape; }
|
||||
|
@ -114,6 +112,8 @@ public:
|
|||
#undef __JS_ENUMERATE
|
||||
|
||||
private:
|
||||
Intrinsics() = default;
|
||||
|
||||
virtual void visit_edges(Visitor&) override;
|
||||
|
||||
void initialize_intrinsics(Realm&);
|
||||
|
|
|
@ -14,11 +14,12 @@ class IteratorPrototype : public Object {
|
|||
JS_OBJECT(IteratorPrototype, Object)
|
||||
|
||||
public:
|
||||
IteratorPrototype(Realm&);
|
||||
virtual void initialize(Realm&) override;
|
||||
virtual ~IteratorPrototype() override = default;
|
||||
|
||||
private:
|
||||
IteratorPrototype(Realm&);
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(symbol_iterator);
|
||||
};
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue