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

LibJS: Stop propagating small OOM errors from the Error object

This commit is contained in:
Timothy Flynn 2023-09-06 08:18:01 -04:00 committed by Tim Flynn
parent df915f8a98
commit 54d1f4e234
17 changed files with 68 additions and 77 deletions

View file

@ -26,7 +26,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<JS::Promise>> ReadableStreamGenericReaderMi
{
// 1. If this.[[stream]] is undefined, return a promise rejected with a TypeError exception.
if (!m_stream) {
auto exception = MUST_OR_THROW_OOM(JS::TypeError::create(m_realm, "No stream present to cancel"sv));
auto exception = JS::TypeError::create(m_realm, "No stream present to cancel"sv);
auto promise_capability = WebIDL::create_rejected_promise(m_realm, exception);
return JS::NonnullGCPtr { verify_cast<JS::Promise>(*promise_capability->promise().ptr()) };
}