Bug 137333

Summary: Have is<>(T*) function do a null check on the pointer argument
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: DOMAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, barraclough, benjamin, commit-queue, darin, gyuyoung.kim, kling, koivisto, rniwa
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

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>