Bug 137333 - Have is<>(T*) function do a null check on the pointer argument
Summary: Have is<>(T*) function do a null check on the pointer argument
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-01 22:18 PDT by Chris Dumez
Modified: 2014-10-02 12:41 PDT (History)
9 users (show)

See Also:


Attachments
Patch (479.99 KB, patch)
2014-10-01 22:39 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (479.99 KB, patch)
2014-10-01 22:59 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (479.92 KB, patch)
2014-10-02 12:38 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2014-10-01 22:18:15 PDT
Have is<>(T*) function do a null check on the argument instead of a simple assertion. This makes sense for 2 reasons:
1. It is more consistent with downcast<>(T*), which will succeed even if the argument is a nullptr
2. It simplifies the code a bit as it gets rid of a lot of explicit null checks
Comment 1 Chris Dumez 2014-10-01 22:39:19 PDT
Created attachment 239084 [details]
Patch
Comment 2 WebKit Commit Bot 2014-10-01 22:42:18 PDT
Attachment 239084 [details] did not pass style-queue:


ERROR: Source/WebCore/editing/CompositeEditCommand.cpp:1354:  Multi line control clauses should use braces.  [whitespace/braces] [4]
ERROR: Source/WebCore/dom/Position.cpp:953:  Multi line control clauses should use braces.  [whitespace/braces] [4]
Total errors found: 2 in 247 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Chris Dumez 2014-10-01 22:59:34 PDT
Created attachment 239086 [details]
Patch
Comment 4 WebKit Commit Bot 2014-10-01 23:02:30 PDT
Attachment 239086 [details] did not pass style-queue:


ERROR: Source/WebCore/editing/CompositeEditCommand.cpp:1354:  Multi line control clauses should use braces.  [whitespace/braces] [4]
ERROR: Source/WebCore/dom/Position.cpp:953:  Multi line control clauses should use braces.  [whitespace/braces] [4]
Total errors found: 2 in 247 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Chris Dumez 2014-10-02 12:38:39 PDT
Created attachment 239129 [details]
Patch
Comment 6 Chris Dumez 2014-10-02 12:41:18 PDT
Committed r174225: <http://trac.webkit.org/changeset/174225>