Skip to content

Commit

Permalink
LibJS+LibWeb: Fix a ton of JS_CELL-like macro issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mattco98 committed May 19, 2024
1 parent 2291129 commit bbf7c01
Show file tree
Hide file tree
Showing 28 changed files with 35 additions and 33 deletions.
2 changes: 1 addition & 1 deletion Userland/Libraries/LibJS/Heap/HeapFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class PromiseResolvingElementFunction : public NativeFunction {

// 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:
Expand All @@ -87,7 +87,7 @@ class PromiseAllResolveElementFunction final : public PromiseResolvingElementFun

// 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:
Expand Down
2 changes: 1 addition & 1 deletion Userland/Libraries/LibJS/Runtime/Temporal/PlainTime.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion Userland/Libraries/LibWeb/Crypto/CryptoKey.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class CryptoKey final

// 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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ class FilteredResponse : public Response {

// 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:
Expand Down
2 changes: 1 addition & 1 deletion Userland/Libraries/LibWeb/FileAPI/FileReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion Userland/Libraries/LibWeb/Geometry/DOMMatrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions Userland/Libraries/LibWeb/Geometry/DOMMatrixReadOnly.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ class DOMMatrixReadOnly
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() };

Expand All @@ -133,8 +135,6 @@ class DOMMatrixReadOnly
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion Userland/Libraries/LibWeb/HTML/EventLoop/EventLoop.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion Userland/Libraries/LibWeb/HTML/EventLoop/Task.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion Userland/Libraries/LibWeb/HTML/EventLoop/TaskQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion Userland/Libraries/LibWeb/HTML/ListOfAvailableImages.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion Userland/Libraries/LibWeb/HTML/Location.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion Userland/Libraries/LibWeb/HTML/Scripting/ModuleMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class ModuleLocationTuple {

// 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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ struct SessionHistoryTraversalQueueEntry : public JS::Cell {

// 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:
Expand Down
2 changes: 1 addition & 1 deletion Userland/Libraries/LibWeb/HTML/SharedImageRequest.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion Userland/Libraries/LibWeb/HTML/WorkerAgent.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion Userland/Libraries/LibWeb/Layout/SVGMaskBox.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
namespace Web::Layout {

class SVGMaskBox : public SVGGraphicsBox {
JS_CELL(SVGMaskBox, SVGBox);
JS_CELL(SVGMaskBox, SVGGraphicsBox);
JS_DECLARE_ALLOCATOR(SVGMaskBox);

public:
Expand Down
2 changes: 1 addition & 1 deletion Userland/Libraries/LibWeb/MathML/MathMLElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion Userland/Libraries/LibWeb/Painting/Paintable.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion Userland/Libraries/LibWeb/SVG/SVGDecodedImageData.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion Userland/Libraries/LibWeb/SVG/SVGStyleElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 5 additions & 5 deletions Userland/Libraries/LibWeb/Streams/AbstractOperations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,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
Expand Down Expand Up @@ -370,7 +370,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:
Expand Down Expand Up @@ -643,7 +643,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)
Expand Down Expand Up @@ -681,7 +681,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:
Expand Down Expand Up @@ -837,7 +837,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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class ReadRequest : public JS::Cell {
};

class ReadLoopReadRequest final : public ReadRequest {
JS_CELL(ReadLoopReadRequest, JS::Cell);
JS_CELL(ReadLoopReadRequest, ReadRequest);
JS_DECLARE_ALLOCATOR(ReadLoopReadRequest);

public:
Expand Down
2 changes: 2 additions & 0 deletions Userland/Utilities/js.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit bbf7c01

Please sign in to comment.