[webkit-changes] [WebKit/WebKit] 6f5dfe: Add operator bool() to NativePromiseRequest object

Jean-Yves Avenard noreply at github.com
Wed Sep 27 21:53:42 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6f5dfe93bc251467650d446e7293613e576e4079
      https://github.com/WebKit/WebKit/commit/6f5dfe93bc251467650d446e7293613e576e4079
  Author: Jean-Yves Avenard <jya at apple.com>
  Date:   2023-09-27 (Wed, 27 Sep 2023)

  Changed paths:
    M Source/WTF/wtf/NativePromise.h
    M Tools/TestWebKitAPI/Tests/WTF/NativePromise.cpp

  Log Message:
  -----------
  Add operator bool() to NativePromiseRequest object
https://bugs.webkit.org/show_bug.cgi?id=262229
rdar://116150545

Reviewed by Dan Glastonbury.

The pattern:
```
if (m_request)
    m_request.disconnect();
```

is a common idiom in the destructor of a class using a NativePromiseRequest.

Amend API test.

* Source/WTF/wtf/NativePromise.h:
* Tools/TestWebKitAPI/Tests/WTF/NativePromise.cpp:
(TestWebKitAPI::TEST):

Canonical link: https://commits.webkit.org/268562@main




More information about the webkit-changes mailing list