Bug 136773 - [Meta] Type cast by using toFoo()
Summary: [Meta] Type cast by using toFoo()
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on: 136809 136403 136609 136628 136766 136774 136775
Blocks:
  Show dependency treegraph
 
Reported: 2014-09-11 23:19 PDT by Gyuyoung Kim
Modified: 2014-09-14 20:06 PDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gyuyoung Kim 2014-09-11 23:19:04 PDT
As I announced in https://lists.webkit.org/pipermail/webkit-dev/2013-September/025532.html, this bug is to track bugs which changes to use toFoo() instead of static_cast<>.

To use toFoo() for type casting, there are below benefits,

 - Bad type cast can be detected by using ASSERTION in toFoo(). The
toFoo() function has an ASSERTION to check if source value is a proper
super class.
 - Unnecessary local variables can be removed. There are some local
variables, which are only used once in WebKit. In those cases, we don’t
need to use a local variable. Besides, we can remove unnecessary ASSERTION
because toFoo() already has it.
 - I believe toFoo() can improve code readability.