mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 05:39:11 +00:00
LibJS+LibWeb: Fix a ton of JS_CELL-like macro issues
This commit is contained in:
parent
f860763c77
commit
9ea6ab0ad4
Notes:
sideshowbarker
2024-07-17 00:23:42 +09:00
Author: https://github.com/mattco98
Commit: 9ea6ab0ad4
Pull-request: https://github.com/SerenityOS/serenity/pull/24422
Issue: https://github.com/SerenityOS/serenity/issues/23880
Issue: https://github.com/SerenityOS/serenity/issues/23881
Issue: https://github.com/SerenityOS/serenity/issues/23900
Reviewed-by: https://github.com/ADKaster ✅
30 changed files with 37 additions and 35 deletions
|
@ -13,7 +13,7 @@
|
|||
namespace JS {
|
||||
|
||||
template<typename T>
|
||||
class HeapFunction final : public JS::Cell {
|
||||
class HeapFunction final : public Cell {
|
||||
JS_CELL(HeapFunction, Cell);
|
||||
|
||||
public:
|
||||
|
|
|
@ -71,7 +71,7 @@ private:
|
|||
|
||||
// 27.2.4.1.3 Promise.all Resolve Element Functions, https://tc39.es/ecma262/#sec-promise.all-resolve-element-functions
|
||||
class PromiseAllResolveElementFunction final : public PromiseResolvingElementFunction {
|
||||
JS_OBJECT(PromiseAllResolveElementFunction, NativeFunction);
|
||||
JS_OBJECT(PromiseAllResolveElementFunction, PromiseResolvingElementFunction);
|
||||
JS_DECLARE_ALLOCATOR(PromiseAllResolveElementFunction);
|
||||
|
||||
public:
|
||||
|
@ -87,7 +87,7 @@ private:
|
|||
|
||||
// 27.2.4.2.2 Promise.allSettled Resolve Element Functions, https://tc39.es/ecma262/#sec-promise.allsettled-resolve-element-functions
|
||||
class PromiseAllSettledResolveElementFunction final : public PromiseResolvingElementFunction {
|
||||
JS_OBJECT(PromiseResolvingFunction, NativeFunction);
|
||||
JS_OBJECT(PromiseAllSettledResolveElementFunction, PromiseResolvingElementFunction);
|
||||
JS_DECLARE_ALLOCATOR(PromiseAllSettledResolveElementFunction);
|
||||
|
||||
public:
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
namespace JS::Temporal {
|
||||
|
||||
class PlainTime final : public Object {
|
||||
JS_OBJECT(PlainDateTime, Object);
|
||||
JS_OBJECT(PlainTime, Object);
|
||||
JS_DECLARE_ALLOCATOR(PlainTime);
|
||||
|
||||
public:
|
||||
|
|
|
@ -69,7 +69,7 @@ private:
|
|||
|
||||
// https://w3c.github.io/webcrypto/#ref-for-dfn-CryptoKeyPair-2
|
||||
class CryptoKeyPair : public JS::Object {
|
||||
JS_OBJECT(CryptoKeyPair, Object);
|
||||
JS_OBJECT(CryptoKeyPair, JS::Object);
|
||||
JS_DECLARE_ALLOCATOR(CryptoKeyPair);
|
||||
|
||||
public:
|
||||
|
|
|
@ -238,7 +238,7 @@ private:
|
|||
|
||||
// https://fetch.spec.whatwg.org/#concept-filtered-response-basic
|
||||
class BasicFilteredResponse final : public FilteredResponse {
|
||||
JS_CELL(OpaqueRedirectFilteredResponse, FilteredResponse);
|
||||
JS_CELL(BasicFilteredResponse, FilteredResponse);
|
||||
JS_DECLARE_ALLOCATOR(BasicFilteredResponse);
|
||||
|
||||
public:
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace Web::Fetch::Infrastructure {
|
|||
|
||||
// https://fetch.spec.whatwg.org/#incrementally-read-loop
|
||||
class IncrementalReadLoopReadRequest : public Streams::ReadRequest {
|
||||
JS_CELL(IncrementalReadLoopReadRequest, JS::Cell);
|
||||
JS_CELL(IncrementalReadLoopReadRequest, Streams::ReadRequest);
|
||||
JS_DECLARE_ALLOCATOR(IncrementalReadLoopReadRequest);
|
||||
|
||||
public:
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace Web::FileAPI {
|
|||
|
||||
// https://w3c.github.io/FileAPI/#dfn-filereader
|
||||
class FileReader : public DOM::EventTarget {
|
||||
WEB_PLATFORM_OBJECT(FileReader, EventTarget);
|
||||
WEB_PLATFORM_OBJECT(FileReader, DOM::EventTarget);
|
||||
JS_DECLARE_ALLOCATOR(FileReader);
|
||||
|
||||
public:
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace Web::Geometry {
|
|||
|
||||
// https://drafts.fxtf.org/geometry/#dommatrix
|
||||
class DOMMatrix : public DOMMatrixReadOnly {
|
||||
WEB_PLATFORM_OBJECT(DOMMatrix, Bindings::PlatformObject);
|
||||
WEB_PLATFORM_OBJECT(DOMMatrix, DOMMatrixReadOnly);
|
||||
JS_DECLARE_ALLOCATOR(DOMMatrix);
|
||||
|
||||
public:
|
||||
|
|
|
@ -125,6 +125,8 @@ protected:
|
|||
DOMMatrixReadOnly(JS::Realm&, DOMMatrixReadOnly const& other);
|
||||
explicit DOMMatrixReadOnly(JS::Realm&);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
// NOTE: The matrix used in the spec is column-major (https://drafts.fxtf.org/geometry/#4x4-abstract-matrix) but Gfx::Matrix4x4 is row-major so we need to transpose the values.
|
||||
Gfx::DoubleMatrix4x4 m_matrix { Gfx::DoubleMatrix4x4::identity() };
|
||||
|
||||
|
@ -133,8 +135,6 @@ protected:
|
|||
private:
|
||||
void initialize_from_create_2d_matrix(double m11, double m12, double m21, double m22, double m41, double m42);
|
||||
void initialize_from_create_3d_matrix(double m11, double m12, double m13, double m14, double m21, double m22, double m23, double m24, double m31, double m32, double m33, double m34, double m41, double m42, double m43, double m44);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
};
|
||||
|
||||
WebIDL::ExceptionOr<void> validate_and_fixup_dom_matrix_2d_init(DOMMatrix2DInit& init);
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
namespace Web::HTML {
|
||||
|
||||
class AnimatedBitmapDecodedImageData final : public DecodedImageData {
|
||||
JS_CELL(AnimatedBitmapDecodedImageData, Cell);
|
||||
JS_CELL(AnimatedBitmapDecodedImageData, DecodedImageData);
|
||||
JS_DECLARE_ALLOCATOR(AnimatedBitmapDecodedImageData);
|
||||
|
||||
public:
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
namespace Web::HTML {
|
||||
|
||||
class EventLoop : public JS::Cell {
|
||||
JS_CELL(EventLoop, Cell);
|
||||
JS_CELL(EventLoop, JS::Cell);
|
||||
JS_DECLARE_ALLOCATOR(EventLoop);
|
||||
|
||||
public:
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace Web::HTML {
|
|||
struct UniqueTaskSource;
|
||||
|
||||
class Task final : public JS::Cell {
|
||||
JS_CELL(Task, Cell);
|
||||
JS_CELL(Task, JS::Cell);
|
||||
JS_DECLARE_ALLOCATOR(Task);
|
||||
|
||||
public:
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
namespace Web::HTML {
|
||||
|
||||
class TaskQueue : public JS::Cell {
|
||||
JS_CELL(TaskQueue, Cell);
|
||||
JS_CELL(TaskQueue, JS::Cell);
|
||||
JS_DECLARE_ALLOCATOR(TaskQueue);
|
||||
|
||||
public:
|
||||
|
|
|
@ -17,7 +17,7 @@ namespace Web::HTML {
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/images.html#list-of-available-images
|
||||
class ListOfAvailableImages : public JS::Cell {
|
||||
JS_CELL(ListOfAvailableImages, Cell);
|
||||
JS_CELL(ListOfAvailableImages, JS::Cell);
|
||||
JS_DECLARE_ALLOCATOR(ListOfAvailableImages);
|
||||
|
||||
public:
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
namespace Web::HTML {
|
||||
|
||||
class Location final : public Bindings::PlatformObject {
|
||||
JS_OBJECT(Location, Bindings::PlatformObject);
|
||||
WEB_PLATFORM_OBJECT(Location, Bindings::PlatformObject);
|
||||
JS_DECLARE_ALLOCATOR(Location);
|
||||
|
||||
public:
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace Web::HTML {
|
|||
class ImportMapParseResult
|
||||
: public JS::Cell
|
||||
, public JS::Script::HostDefined {
|
||||
JS_CELL(Script, JS::Cell);
|
||||
JS_CELL(ImportMapParseResult, JS::Cell);
|
||||
JS_DECLARE_ALLOCATOR(ImportMapParseResult);
|
||||
|
||||
public:
|
||||
|
|
|
@ -36,7 +36,7 @@ private:
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#module-map
|
||||
class ModuleMap final : public JS::Cell {
|
||||
JS_CELL(ModuleMap, Cell);
|
||||
JS_CELL(ModuleMap, JS::Cell);
|
||||
JS_DECLARE_ALLOCATOR(ModuleMap);
|
||||
|
||||
public:
|
||||
|
|
|
@ -43,7 +43,7 @@ private:
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/document-sequences.html#tn-session-history-traversal-queue
|
||||
class SessionHistoryTraversalQueue : public JS::Cell {
|
||||
JS_CELL(SessionHistoryTraversalQueue, Cell);
|
||||
JS_CELL(SessionHistoryTraversalQueue, JS::Cell);
|
||||
JS_DECLARE_ALLOCATOR(SessionHistoryTraversalQueue);
|
||||
|
||||
public:
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
namespace Web::HTML {
|
||||
|
||||
class SharedImageRequest final : public JS::Cell {
|
||||
JS_CELL(ImageRequest, JS::Cell);
|
||||
JS_CELL(SharedImageRequest, JS::Cell);
|
||||
JS_DECLARE_ALLOCATOR(SharedImageRequest);
|
||||
|
||||
public:
|
||||
|
|
|
@ -19,7 +19,7 @@ struct WorkerOptions {
|
|||
};
|
||||
|
||||
class WorkerAgent : public JS::Cell {
|
||||
JS_CELL(Agent, JS::Cell);
|
||||
JS_CELL(WorkerAgent, JS::Cell);
|
||||
JS_DECLARE_ALLOCATOR(WorkerAgent);
|
||||
|
||||
WorkerAgent(URL::URL url, WorkerOptions const& options, JS::GCPtr<MessagePort> outside_port, JS::NonnullGCPtr<EnvironmentSettingsObject> outside_settings);
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
namespace Web::IndexedDB {
|
||||
|
||||
class IDBRequest : public DOM::EventTarget {
|
||||
WEB_PLATFORM_OBJECT(IDBRequest, EventTarget);
|
||||
WEB_PLATFORM_OBJECT(IDBRequest, DOM::EventTarget);
|
||||
JS_DECLARE_ALLOCATOR(IDBRequest);
|
||||
|
||||
public:
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
namespace Web::Layout {
|
||||
|
||||
class SVGMaskBox : public SVGGraphicsBox {
|
||||
JS_CELL(SVGMaskBox, SVGBox);
|
||||
JS_CELL(SVGMaskBox, SVGGraphicsBox);
|
||||
JS_DECLARE_ALLOCATOR(SVGMaskBox);
|
||||
|
||||
public:
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace Web::MathML {
|
|||
|
||||
class MathMLElement : public DOM::Element
|
||||
, public HTML::GlobalEventHandlers {
|
||||
WEB_PLATFORM_OBJECT(MathMLElement, Element);
|
||||
WEB_PLATFORM_OBJECT(MathMLElement, DOM::Element);
|
||||
JS_DECLARE_ALLOCATOR(MathMLElement);
|
||||
|
||||
public:
|
||||
|
|
|
@ -45,7 +45,7 @@ enum class HitTestType {
|
|||
class Paintable
|
||||
: public JS::Cell
|
||||
, public TreeNode<Paintable> {
|
||||
JS_CELL(Paintable, Cell);
|
||||
JS_CELL(Paintable, JS::Cell);
|
||||
|
||||
public:
|
||||
virtual ~Paintable();
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
namespace Web::SVG {
|
||||
|
||||
class SVGDecodedImageData final : public HTML::DecodedImageData {
|
||||
JS_CELL(SVGDecodedImageData, Cell);
|
||||
JS_CELL(SVGDecodedImageData, HTML::DecodedImageData);
|
||||
JS_DECLARE_ALLOCATOR(SVGDecodedImageData);
|
||||
|
||||
public:
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
namespace Web::SVG {
|
||||
|
||||
class SVGStyleElement final : public SVGElement {
|
||||
WEB_PLATFORM_OBJECT(HTMLStyleElement, SVGElement);
|
||||
WEB_PLATFORM_OBJECT(SVGStyleElement, SVGElement);
|
||||
JS_DECLARE_ALLOCATOR(SVGStyleElement);
|
||||
|
||||
public:
|
||||
|
|
|
@ -350,7 +350,7 @@ WebIDL::ExceptionOr<ReadableStreamPair> readable_stream_tee(JS::Realm& realm, Re
|
|||
}
|
||||
|
||||
struct DefaultStreamTeeParams final : JS::Cell {
|
||||
JS_CELL(TeeParams, JS::Cell);
|
||||
JS_CELL(DefaultStreamTeeParams, JS::Cell);
|
||||
JS_DECLARE_ALLOCATOR(DefaultStreamTeeParams);
|
||||
|
||||
virtual void visit_edges(Visitor& visitor) override
|
||||
|
@ -378,7 +378,7 @@ JS_DEFINE_ALLOCATOR(DefaultStreamTeeParams);
|
|||
|
||||
// https://streams.spec.whatwg.org/#ref-for-read-request③
|
||||
class DefaultStreamTeeReadRequest final : public ReadRequest {
|
||||
JS_CELL(DefaultStreamTeeReadRequest, Cell);
|
||||
JS_CELL(DefaultStreamTeeReadRequest, ReadRequest);
|
||||
JS_DECLARE_ALLOCATOR(DefaultStreamTeeReadRequest);
|
||||
|
||||
public:
|
||||
|
@ -651,7 +651,7 @@ WebIDL::ExceptionOr<ReadableStreamPair> readable_stream_default_tee(JS::Realm& r
|
|||
}
|
||||
|
||||
struct ByteStreamTeeParams final : JS::Cell {
|
||||
JS_CELL(TeeParams, JS::Cell);
|
||||
JS_CELL(ByteStreamTeeParams, JS::Cell);
|
||||
JS_DECLARE_ALLOCATOR(ByteStreamTeeParams);
|
||||
|
||||
explicit ByteStreamTeeParams(ReadableStreamReader reader)
|
||||
|
@ -689,7 +689,7 @@ JS_DEFINE_ALLOCATOR(ByteStreamTeeParams);
|
|||
|
||||
// https://streams.spec.whatwg.org/#ref-for-read-request④
|
||||
class ByteStreamTeeDefaultReadRequest final : public ReadRequest {
|
||||
JS_CELL(ByteStreamTeeDefaultReadRequest, Cell);
|
||||
JS_CELL(ByteStreamTeeDefaultReadRequest, ReadRequest);
|
||||
JS_DECLARE_ALLOCATOR(ByteStreamTeeDefaultReadRequest);
|
||||
|
||||
public:
|
||||
|
@ -845,7 +845,7 @@ JS_DEFINE_ALLOCATOR(ByteStreamTeeDefaultReadRequest);
|
|||
|
||||
// https://streams.spec.whatwg.org/#ref-for-read-into-request②
|
||||
class ByteStreamTeeBYOBReadRequest final : public ReadIntoRequest {
|
||||
JS_CELL(ByteStreamTeeBYOBReadRequest, Cell);
|
||||
JS_CELL(ByteStreamTeeBYOBReadRequest, ReadIntoRequest);
|
||||
JS_DECLARE_ALLOCATOR(ByteStreamTeeBYOBReadRequest);
|
||||
|
||||
public:
|
||||
|
|
|
@ -119,7 +119,7 @@ void ReadLoopReadRequest::on_error(JS::Value error)
|
|||
}
|
||||
|
||||
class DefaultReaderReadRequest final : public ReadRequest {
|
||||
JS_CELL(DefaultReaderReadRequest, Cell);
|
||||
JS_CELL(DefaultReaderReadRequest, ReadRequest);
|
||||
JS_DECLARE_ALLOCATOR(DefaultReaderReadRequest);
|
||||
|
||||
public:
|
||||
|
|
|
@ -32,7 +32,7 @@ public:
|
|||
};
|
||||
|
||||
class ReadLoopReadRequest final : public ReadRequest {
|
||||
JS_CELL(ReadLoopReadRequest, JS::Cell);
|
||||
JS_CELL(ReadLoopReadRequest, ReadRequest);
|
||||
JS_DECLARE_ALLOCATOR(ReadLoopReadRequest);
|
||||
|
||||
public:
|
||||
|
|
|
@ -445,6 +445,8 @@ static ErrorOr<void> repl(JS::Realm& realm)
|
|||
}
|
||||
|
||||
class ReplConsoleClient final : public JS::ConsoleClient {
|
||||
JS_CELL(ReplConsoleClient, JS::ConsoleClient);
|
||||
|
||||
public:
|
||||
ReplConsoleClient(JS::Console& console)
|
||||
: ConsoleClient(console)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue