Bug 225553

Summary: Introduce JSObject::getIfPropertyExists helper
Product: WebKit Reporter: Ross Kirsling <ross.kirsling>
Component: New BugsAssignee: Ross Kirsling <ross.kirsling>
Status: RESOLVED FIXED    
Severity: Normal CC: ashvayka, ews-watchlist, keith_miller, mark.lam, msaboff, saam, tzagallo, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch for landing
ews-feeder: commit-queue-
Patch for landing none

Description Ross Kirsling 2021-05-07 20:03:42 PDT
Introduce JSObject::getIfPropertyExists helper
Comment 1 Ross Kirsling 2021-05-07 20:07:31 PDT
Created attachment 428074 [details]
Patch
Comment 2 Alexey Shvayka 2021-05-07 20:41:26 PDT
Comment on attachment 428074 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=428074&action=review

Sweet! Thank you for the follow-up. I presume there might be more usages for getIfPropertyExists() in future (like around GetBindingValue).

r=me with error handling suggestion.

> Source/JavaScriptCore/runtime/JSObjectInlines.h:205
> +

Since getIfPropertyExists() call sites should check exception either way, I think we can completely drop exception handling from this helper.
At this point (hasProperty: true), we are guaranteed to be exception-free, and can just return the ternary expression.
Comment 3 Ross Kirsling 2021-05-07 23:43:04 PDT
Created attachment 428081 [details]
Patch for landing
Comment 4 Ross Kirsling 2021-05-07 23:47:00 PDT
Created attachment 428082 [details]
Patch for landing
Comment 5 EWS 2021-05-08 00:23:00 PDT Comment hidden (obsolete)
Comment 6 EWS 2021-05-08 00:32:54 PDT
Committed r277224 (237495@main): <https://commits.webkit.org/237495@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 428082 [details].
Comment 7 Radar WebKit Bug Importer 2021-05-08 00:33:14 PDT
<rdar://problem/77690047>