mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
LibWeb: Remove exceptional return types from infallible stream AOs
This commit is contained in:
parent
c29916775e
commit
572a7bb313
Notes:
sideshowbarker
2024-07-17 01:53:23 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/572a7bb313 Pull-request: https://github.com/SerenityOS/serenity/pull/24165 Reviewed-by: https://github.com/kennethmyhra ✅ Reviewed-by: https://github.com/shannonbooth ✅
5 changed files with 9 additions and 13 deletions
|
@ -4012,7 +4012,7 @@ Optional<double> writable_stream_default_writer_get_desired_size(WritableStreamD
|
|||
}
|
||||
|
||||
// https://streams.spec.whatwg.org/#writable-stream-default-writer-release
|
||||
WebIDL::ExceptionOr<void> writable_stream_default_writer_release(WritableStreamDefaultWriter& writer)
|
||||
void writable_stream_default_writer_release(WritableStreamDefaultWriter& writer)
|
||||
{
|
||||
auto& realm = writer.realm();
|
||||
|
||||
|
@ -4039,8 +4039,6 @@ WebIDL::ExceptionOr<void> writable_stream_default_writer_release(WritableStreamD
|
|||
|
||||
// 8. Set writer.[[stream]] to undefined.
|
||||
writer.set_stream({});
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
// https://streams.spec.whatwg.org/#writable-stream-default-writer-write
|
||||
|
@ -4592,7 +4590,7 @@ void set_up_transform_stream_default_controller(TransformStream& stream, Transfo
|
|||
}
|
||||
|
||||
// https://streams.spec.whatwg.org/#set-up-transform-stream-default-controller-from-transformer
|
||||
WebIDL::ExceptionOr<void> set_up_transform_stream_default_controller_from_transformer(TransformStream& stream, JS::Value transformer, Transformer& transformer_dict)
|
||||
void set_up_transform_stream_default_controller_from_transformer(TransformStream& stream, JS::Value transformer, Transformer& transformer_dict)
|
||||
{
|
||||
auto& realm = stream.realm();
|
||||
auto& vm = realm.vm();
|
||||
|
@ -4643,8 +4641,6 @@ WebIDL::ExceptionOr<void> set_up_transform_stream_default_controller_from_transf
|
|||
|
||||
// 6. Perform ! SetUpTransformStreamDefaultController(stream, controller, transformAlgorithm, flushAlgorithm).
|
||||
set_up_transform_stream_default_controller(stream, *controller, transform_algorithm, flush_algorithm);
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
// https://streams.spec.whatwg.org/#transform-stream-default-controller-clear-algorithms
|
||||
|
|
|
@ -147,7 +147,7 @@ JS::NonnullGCPtr<WebIDL::Promise> writable_stream_default_writer_close(WritableS
|
|||
void writable_stream_default_writer_ensure_closed_promise_rejected(WritableStreamDefaultWriter&, JS::Value error);
|
||||
void writable_stream_default_writer_ensure_ready_promise_rejected(WritableStreamDefaultWriter&, JS::Value error);
|
||||
Optional<double> writable_stream_default_writer_get_desired_size(WritableStreamDefaultWriter const&);
|
||||
WebIDL::ExceptionOr<void> writable_stream_default_writer_release(WritableStreamDefaultWriter&);
|
||||
void writable_stream_default_writer_release(WritableStreamDefaultWriter&);
|
||||
JS::NonnullGCPtr<WebIDL::Promise> writable_stream_default_writer_write(WritableStreamDefaultWriter&, JS::Value chunk);
|
||||
|
||||
WebIDL::ExceptionOr<void> set_up_writable_stream_default_controller(WritableStream&, WritableStreamDefaultController&, JS::NonnullGCPtr<StartAlgorithm>, JS::NonnullGCPtr<WriteAlgorithm>, JS::NonnullGCPtr<CloseAlgorithm>, JS::NonnullGCPtr<AbortAlgorithm>, double high_water_mark, JS::NonnullGCPtr<SizeAlgorithm>);
|
||||
|
@ -166,7 +166,7 @@ void writable_stream_default_controller_write(WritableStreamDefaultController&,
|
|||
|
||||
void initialize_transform_stream(TransformStream&, JS::NonnullGCPtr<JS::PromiseCapability> start_promise, double writable_high_water_mark, JS::NonnullGCPtr<SizeAlgorithm> writable_size_algorithm, double readable_high_water_mark, JS::NonnullGCPtr<SizeAlgorithm> readable_size_algorithm);
|
||||
void set_up_transform_stream_default_controller(TransformStream&, TransformStreamDefaultController&, JS::NonnullGCPtr<TransformAlgorithm>, JS::NonnullGCPtr<FlushAlgorithm>);
|
||||
WebIDL::ExceptionOr<void> set_up_transform_stream_default_controller_from_transformer(TransformStream&, JS::Value transformer, Transformer&);
|
||||
void set_up_transform_stream_default_controller_from_transformer(TransformStream&, JS::Value transformer, Transformer&);
|
||||
void transform_stream_default_controller_clear_algorithms(TransformStreamDefaultController&);
|
||||
WebIDL::ExceptionOr<void> transform_stream_default_controller_enqueue(TransformStreamDefaultController&, JS::Value chunk);
|
||||
void transform_stream_default_controller_error(TransformStreamDefaultController&, JS::Value error);
|
||||
|
|
|
@ -58,7 +58,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<TransformStream>> TransformStream::construc
|
|||
initialize_transform_stream(*stream, start_promise, writable_high_water_mark, move(writable_size_algorithm), readable_high_water_mark, move(readable_size_algorithm));
|
||||
|
||||
// 11. Perform ? SetUpTransformStreamDefaultControllerFromTransformer(this, transformer, transformerDict).
|
||||
TRY(set_up_transform_stream_default_controller_from_transformer(*stream, transformer, transformer_dict));
|
||||
set_up_transform_stream_default_controller_from_transformer(*stream, transformer, transformer_dict);
|
||||
|
||||
// 12. If transformerDict["start"] exists, then resolve startPromise with the result of invoking
|
||||
// transformerDict["start"] with argument list « this.[[controller]] » and callback this value transformer.
|
||||
|
|
|
@ -90,19 +90,19 @@ JS::GCPtr<JS::Object> WritableStreamDefaultWriter::close()
|
|||
}
|
||||
|
||||
// https://streams.spec.whatwg.org/#default-writer-release-lock
|
||||
WebIDL::ExceptionOr<void> WritableStreamDefaultWriter::release_lock()
|
||||
void WritableStreamDefaultWriter::release_lock()
|
||||
{
|
||||
// 1. Let stream be this.[[stream]].
|
||||
|
||||
// 2. If stream is undefined, return.
|
||||
if (!m_stream)
|
||||
return {};
|
||||
return;
|
||||
|
||||
// 3. Assert: stream.[[writer]] is not undefined.
|
||||
VERIFY(m_stream->writer());
|
||||
|
||||
// 4. Perform ! WritableStreamDefaultWriterRelease(this).
|
||||
return writable_stream_default_writer_release(*this);
|
||||
writable_stream_default_writer_release(*this);
|
||||
}
|
||||
|
||||
// https://streams.spec.whatwg.org/#default-writer-write
|
||||
|
|
|
@ -30,7 +30,7 @@ public:
|
|||
JS::GCPtr<JS::Object> ready();
|
||||
JS::GCPtr<JS::Object> abort(JS::Value reason);
|
||||
JS::GCPtr<JS::Object> close();
|
||||
WebIDL::ExceptionOr<void> release_lock();
|
||||
void release_lock();
|
||||
JS::GCPtr<JS::Object> write(JS::Value chunk);
|
||||
|
||||
JS::GCPtr<WebIDL::Promise> closed_promise() { return m_closed_promise; }
|
||||
|
|
Loading…
Reference in a new issue