mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 04:37:44 +00:00
LibWeb: Implement TransformStreamDefaultController::enqueue()
This commit is contained in:
parent
e028918a64
commit
4ae82983a4
3 changed files with 11 additions and 1 deletions
|
@ -43,6 +43,15 @@ Optional<double> TransformStreamDefaultController::desired_size()
|
|||
return readable_stream_default_controller_get_desired_size(*readable_controller);
|
||||
}
|
||||
|
||||
// https://streams.spec.whatwg.org/#ts-default-controller-enqueue
|
||||
WebIDL::ExceptionOr<void> TransformStreamDefaultController::enqueue(Optional<JS::Value> chunk)
|
||||
{
|
||||
// 1. Perform ? TransformStreamDefaultControllerEnqueue(this, chunk).
|
||||
TRY(transform_stream_default_controller_enqueue(*this, chunk.has_value() ? chunk.value() : JS::js_undefined()));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
// https://streams.spec.whatwg.org/#ts-default-controller-error
|
||||
WebIDL::ExceptionOr<void> TransformStreamDefaultController::error(Optional<JS::Value> reason)
|
||||
{
|
||||
|
|
|
@ -19,6 +19,7 @@ public:
|
|||
virtual ~TransformStreamDefaultController() override;
|
||||
|
||||
Optional<double> desired_size();
|
||||
WebIDL::ExceptionOr<void> enqueue(Optional<JS::Value> chunk);
|
||||
WebIDL::ExceptionOr<void> error(Optional<JS::Value> reason = {});
|
||||
|
||||
auto& flush_algorithm() { return m_flush_algorithm; }
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
interface TransformStreamDefaultController {
|
||||
readonly attribute unrestricted double? desiredSize;
|
||||
|
||||
// FIXME: undefined enqueue(optional any chunk);
|
||||
undefined enqueue(optional any chunk);
|
||||
undefined error(optional any reason);
|
||||
// FIXME: undefined terminate();
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue