瀏覽代碼

LibJS+LibWeb: Fix a ton of JS_CELL-like macro issues

Matthew Olsson 1 年之前
父節點
當前提交
9ea6ab0ad4
共有 30 個文件被更改,包括 37 次插入35 次删除
  1. 1 1
      Userland/Libraries/LibJS/Heap/HeapFunction.h
  2. 2 2
      Userland/Libraries/LibJS/Runtime/PromiseResolvingElementFunctions.h
  3. 1 1
      Userland/Libraries/LibJS/Runtime/Temporal/PlainTime.h
  4. 1 1
      Userland/Libraries/LibWeb/Crypto/CryptoKey.h
  5. 1 1
      Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Responses.h
  6. 1 1
      Userland/Libraries/LibWeb/Fetch/Infrastructure/IncrementalReadLoopReadRequest.h
  7. 1 1
      Userland/Libraries/LibWeb/FileAPI/FileReader.h
  8. 1 1
      Userland/Libraries/LibWeb/Geometry/DOMMatrix.h
  9. 2 2
      Userland/Libraries/LibWeb/Geometry/DOMMatrixReadOnly.h
  10. 1 1
      Userland/Libraries/LibWeb/HTML/AnimatedBitmapDecodedImageData.h
  11. 1 1
      Userland/Libraries/LibWeb/HTML/EventLoop/EventLoop.h
  12. 1 1
      Userland/Libraries/LibWeb/HTML/EventLoop/Task.h
  13. 1 1
      Userland/Libraries/LibWeb/HTML/EventLoop/TaskQueue.h
  14. 1 1
      Userland/Libraries/LibWeb/HTML/ListOfAvailableImages.h
  15. 1 1
      Userland/Libraries/LibWeb/HTML/Location.h
  16. 1 1
      Userland/Libraries/LibWeb/HTML/Scripting/ImportMapParseResult.h
  17. 1 1
      Userland/Libraries/LibWeb/HTML/Scripting/ModuleMap.h
  18. 1 1
      Userland/Libraries/LibWeb/HTML/SessionHistoryTraversalQueue.h
  19. 1 1
      Userland/Libraries/LibWeb/HTML/SharedImageRequest.h
  20. 1 1
      Userland/Libraries/LibWeb/HTML/WorkerAgent.h
  21. 1 1
      Userland/Libraries/LibWeb/IndexedDB/IDBRequest.h
  22. 1 1
      Userland/Libraries/LibWeb/Layout/SVGMaskBox.h
  23. 1 1
      Userland/Libraries/LibWeb/MathML/MathMLElement.h
  24. 1 1
      Userland/Libraries/LibWeb/Painting/Paintable.h
  25. 1 1
      Userland/Libraries/LibWeb/SVG/SVGDecodedImageData.h
  26. 1 1
      Userland/Libraries/LibWeb/SVG/SVGStyleElement.h
  27. 5 5
      Userland/Libraries/LibWeb/Streams/AbstractOperations.cpp
  28. 1 1
      Userland/Libraries/LibWeb/Streams/ReadableStreamDefaultReader.cpp
  29. 1 1
      Userland/Libraries/LibWeb/Streams/ReadableStreamDefaultReader.h
  30. 2 0
      Userland/Utilities/js.cpp

+ 1 - 1
Userland/Libraries/LibJS/Heap/HeapFunction.h

@@ -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:

+ 2 - 2
Userland/Libraries/LibJS/Runtime/PromiseResolvingElementFunctions.h

@@ -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:

+ 1 - 1
Userland/Libraries/LibJS/Runtime/Temporal/PlainTime.h

@@ -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:

+ 1 - 1
Userland/Libraries/LibWeb/Crypto/CryptoKey.h

@@ -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:

+ 1 - 1
Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Responses.h

@@ -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:

+ 1 - 1
Userland/Libraries/LibWeb/Fetch/Infrastructure/IncrementalReadLoopReadRequest.h

@@ -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:

+ 1 - 1
Userland/Libraries/LibWeb/FileAPI/FileReader.h

@@ -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:

+ 1 - 1
Userland/Libraries/LibWeb/Geometry/DOMMatrix.h

@@ -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:

+ 2 - 2
Userland/Libraries/LibWeb/Geometry/DOMMatrixReadOnly.h

@@ -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);

+ 1 - 1
Userland/Libraries/LibWeb/HTML/AnimatedBitmapDecodedImageData.h

@@ -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:

+ 1 - 1
Userland/Libraries/LibWeb/HTML/EventLoop/EventLoop.h

@@ -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:

+ 1 - 1
Userland/Libraries/LibWeb/HTML/EventLoop/Task.h

@@ -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:

+ 1 - 1
Userland/Libraries/LibWeb/HTML/EventLoop/TaskQueue.h

@@ -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:

+ 1 - 1
Userland/Libraries/LibWeb/HTML/ListOfAvailableImages.h

@@ -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:

+ 1 - 1
Userland/Libraries/LibWeb/HTML/Location.h

@@ -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:

+ 1 - 1
Userland/Libraries/LibWeb/HTML/Scripting/ImportMapParseResult.h

@@ -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:

+ 1 - 1
Userland/Libraries/LibWeb/HTML/Scripting/ModuleMap.h

@@ -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:

+ 1 - 1
Userland/Libraries/LibWeb/HTML/SessionHistoryTraversalQueue.h

@@ -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:

+ 1 - 1
Userland/Libraries/LibWeb/HTML/SharedImageRequest.h

@@ -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:

+ 1 - 1
Userland/Libraries/LibWeb/HTML/WorkerAgent.h

@@ -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);

+ 1 - 1
Userland/Libraries/LibWeb/IndexedDB/IDBRequest.h

@@ -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:

+ 1 - 1
Userland/Libraries/LibWeb/Layout/SVGMaskBox.h

@@ -13,7 +13,7 @@
 namespace Web::Layout {
 
 class SVGMaskBox : public SVGGraphicsBox {
-    JS_CELL(SVGMaskBox, SVGBox);
+    JS_CELL(SVGMaskBox, SVGGraphicsBox);
     JS_DECLARE_ALLOCATOR(SVGMaskBox);
 
 public:

+ 1 - 1
Userland/Libraries/LibWeb/MathML/MathMLElement.h

@@ -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:

+ 1 - 1
Userland/Libraries/LibWeb/Painting/Paintable.h

@@ -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();

+ 1 - 1
Userland/Libraries/LibWeb/SVG/SVGDecodedImageData.h

@@ -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:

+ 1 - 1
Userland/Libraries/LibWeb/SVG/SVGStyleElement.h

@@ -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:

+ 5 - 5
Userland/Libraries/LibWeb/Streams/AbstractOperations.cpp

@@ -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:

+ 1 - 1
Userland/Libraries/LibWeb/Streams/ReadableStreamDefaultReader.cpp

@@ -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:

+ 1 - 1
Userland/Libraries/LibWeb/Streams/ReadableStreamDefaultReader.h

@@ -32,7 +32,7 @@ public:
 };
 
 class ReadLoopReadRequest final : public ReadRequest {
-    JS_CELL(ReadLoopReadRequest, JS::Cell);
+    JS_CELL(ReadLoopReadRequest, ReadRequest);
     JS_DECLARE_ALLOCATOR(ReadLoopReadRequest);
 
 public:

+ 2 - 0
Userland/Utilities/js.cpp

@@ -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)