@@ -182,7 +182,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<Request>> Request::construct_impl(JS::Realm
182
182
183
183
// method
184
184
// request’s method.
185
- request->set_method (TRY_OR_THROW_OOM (vm, ByteBuffer::copy (input_request->method ())));
185
+ request->set_method (MUST ( ByteBuffer::copy (input_request->method ())));
186
186
187
187
// header list
188
188
// A copy of request’s header list.
@@ -373,7 +373,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<Request>> Request::construct_impl(JS::Realm
373
373
return WebIDL::SimpleException { WebIDL::SimpleExceptionType::TypeError, " Method must not be one of CONNECT, TRACE, or TRACK" sv };
374
374
375
375
// 3. Normalize method.
376
- method = TRY_OR_THROW_OOM (vm, String::from_utf8 (Infrastructure::normalize_method (method.bytes ())));
376
+ method = MUST ( String::from_utf8 (Infrastructure::normalize_method (method.bytes ())));
377
377
378
378
// 4. Set request’s method to method.
379
379
request->set_method (MUST (ByteBuffer::copy (method.bytes ())));
@@ -503,21 +503,17 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<Request>> Request::construct_impl(JS::Realm
503
503
}
504
504
505
505
// https://fetch.spec.whatwg.org/#dom-request-method
506
- WebIDL::ExceptionOr< String> Request::method () const
506
+ String Request::method () const
507
507
{
508
- auto & vm = this ->vm ();
509
-
510
508
// The method getter steps are to return this’s request’s method.
511
- return TRY_OR_THROW_OOM (vm, String::from_utf8 (m_request->method ()));
509
+ return MUST ( String::from_utf8 (m_request->method ()));
512
510
}
513
511
514
512
// https://fetch.spec.whatwg.org/#dom-request-url
515
- WebIDL::ExceptionOr< String> Request::url () const
513
+ String Request::url () const
516
514
{
517
- auto & vm = this ->vm ();
518
-
519
515
// The url getter steps are to return this’s request’s URL, serialized.
520
- return TRY_OR_THROW_OOM (vm, String::from_byte_string (m_request->url ().serialize ()));
516
+ return MUST ( String::from_byte_string (m_request->url ().serialize ()));
521
517
}
522
518
523
519
// https://fetch.spec.whatwg.org/#dom-request-headers
@@ -535,11 +531,10 @@ Bindings::RequestDestination Request::destination() const
535
531
}
536
532
537
533
// https://fetch.spec.whatwg.org/#dom-request-referrer
538
- WebIDL::ExceptionOr< String> Request::referrer () const
534
+ String Request::referrer () const
539
535
{
540
- auto & vm = this ->vm ();
541
536
return m_request->referrer ().visit (
542
- [&](Infrastructure::Request::Referrer const & referrer) -> WebIDL::ExceptionOr<String> {
537
+ [&](Infrastructure::Request::Referrer const & referrer) {
543
538
switch (referrer) {
544
539
// 1. If this’s request’s referrer is "no-referrer", then return the empty string.
545
540
case Infrastructure::Request::Referrer::NoReferrer:
@@ -551,9 +546,9 @@ WebIDL::ExceptionOr<String> Request::referrer() const
551
546
VERIFY_NOT_REACHED ();
552
547
}
553
548
},
554
- [&](URL::URL const & url) -> WebIDL::ExceptionOr<String> {
549
+ [&](URL::URL const & url) {
555
550
// 3. Return this’s request’s referrer, serialized.
556
- return TRY_OR_THROW_OOM (vm, String::from_byte_string (url.serialize ()));
551
+ return MUST ( String::from_byte_string (url.serialize ()));
557
552
});
558
553
}
559
554
0 commit comments