1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 01:07:35 +00:00

LibWeb: Fix IDL getter for ReadableByteStreamController byobRequest

We were previously only returning the controllers current
[[byobRequest]] instead of taking into account pending pull intos.

Rename the getter function which would return the controllers
[[byobRequest]] slot to `raw_byob_request` to differentiate it from
the IDL getter.

This also leaves a FIXME for a spec step which we are also not currently
implementing correctly.
This commit is contained in:
Shannon Booth 2023-12-02 20:13:34 +13:00 committed by Andreas Kling
parent 1e607f5775
commit 9d0700e770
4 changed files with 52 additions and 5 deletions

View file

@ -77,10 +77,15 @@ class ReadableByteStreamController : public Bindings::PlatformObject {
public:
virtual ~ReadableByteStreamController() override = default;
JS::GCPtr<ReadableStreamBYOBRequest const> byob_request() const { return m_byob_request; }
JS::GCPtr<ReadableStreamBYOBRequest> byob_request() { return m_byob_request; }
// IDL getter, returns current [[byobRequest]] (if any), and otherwise the [[byobRequest]] for the next pending pull into request
JS::GCPtr<ReadableStreamBYOBRequest> byob_request();
void set_byob_request(JS::GCPtr<ReadableStreamBYOBRequest> request) { m_byob_request = request; }
// Raw [[byobRequest]] slot
JS::GCPtr<ReadableStreamBYOBRequest const> raw_byob_request() const { return m_byob_request; }
JS::GCPtr<ReadableStreamBYOBRequest> raw_byob_request() { return m_byob_request; }
Optional<double> desired_size() const;
WebIDL::ExceptionOr<void> close();
void error(JS::Value error);