Bug 246494 - [webkitcorepy] Add NullContext
Summary: [webkitcorepy] Add NullContext
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jonathan Bedard
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-10-13 17:03 PDT by Jonathan Bedard
Modified: 2022-10-18 12:15 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Bedard 2022-10-13 17:03:31 PDT
It often makes code simpler if we can have a context object which is esentially a no-op and resolves to 'False' in an "if" statement. The specific use case in mind is code which may, or may not, define a process depending on arguments passed to it. It's cleanest to handle this process via a "with" statement, but that's not possible without an object that acts as a no-op context manager.
Comment 1 Radar WebKit Bug Importer 2022-10-13 17:07:12 PDT
<rdar://problem/101150808>
Comment 2 Jonathan Bedard 2022-10-13 17:09:20 PDT
Pull request: https://github.com/WebKit/WebKit/pull/5356
Comment 3 EWS 2022-10-13 18:18:45 PDT
Committed 255517@main (5e26e2d126df): <https://commits.webkit.org/255517@main>

Reviewed commits have been landed. Closing PR #5356 and removing active labels.
Comment 4 EWS 2022-10-18 12:15:20 PDT
Committed 252432.591@safari-7614-branch (83e4478c2603): <https://commits.webkit.org/252432.591@safari-7614-branch>

Reviewed commits have been landed. Closing PR #142 and removing active labels.