1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 02:38:13 +00:00

BindingsGenerator+LibWeb: Pass a VM to static IDL-based functions

This saves us from having to yoink the VM out of thin air.
This commit is contained in:
Sam Atkins 2022-10-05 17:09:26 +01:00 committed by Linus Groh
parent 8a78679152
commit 0823a3c422
4 changed files with 14 additions and 11 deletions

View file

@ -44,9 +44,9 @@ public:
[[nodiscard]] NonnullRefPtr<Infrastructure::Response> response() const { return m_response; }
// JS API functions
[[nodiscard]] static JS::NonnullGCPtr<Response> error();
[[nodiscard]] static WebIDL::ExceptionOr<JS::NonnullGCPtr<Response>> redirect(String const& url, u16 status);
[[nodiscard]] static WebIDL::ExceptionOr<JS::NonnullGCPtr<Response>> json(JS::Value data, ResponseInit const& init = {});
[[nodiscard]] static JS::NonnullGCPtr<Response> error(JS::VM&);
[[nodiscard]] static WebIDL::ExceptionOr<JS::NonnullGCPtr<Response>> redirect(JS::VM&, String const& url, u16 status);
[[nodiscard]] static WebIDL::ExceptionOr<JS::NonnullGCPtr<Response>> json(JS::VM&, JS::Value data, ResponseInit const& init = {});
[[nodiscard]] Bindings::ResponseType type() const;
[[nodiscard]] String url() const;
[[nodiscard]] bool redirected() const;