RESOLVED FIXED 112758
[V8] Simplify implementation of EnforceRange conversions
https://bugs.webkit.org/show_bug.cgi?id=112758
Summary [V8] Simplify implementation of EnforceRange conversions
Michael Pruett
Reported 2013-03-19 17:40:10 PDT
The implementation of EnforceRange in conversion functions in V8Bindings.cpp involves some repetition which could be refactored into a common helper method. Furthermore the formula for rounding to the nearest integer not greater in absolute value can be stated in a more concise manner.
Attachments
Patch (4.95 KB, patch)
2013-03-19 20:52 PDT, Michael Pruett
no flags
Patch (4.95 KB, patch)
2013-03-19 21:14 PDT, Michael Pruett
no flags
Michael Pruett
Comment 1 2013-03-19 17:51:11 PDT
Rounding to the nearest integer not greater in absolute value, currently accomplished using the following formula in V8Binding.cpp: x = (x < 0 ? -1 : 1) * floor(fabs(x)) can be expressed more succinctly: x = trunc(x)
Michael Pruett
Comment 2 2013-03-19 20:52:51 PDT
Joshua Bell
Comment 3 2013-03-19 21:04:05 PDT
Nice, thanks for the cleanup.
Michael Pruett
Comment 4 2013-03-19 21:14:24 PDT
Kentaro Hara
Comment 5 2013-03-19 21:15:04 PDT
Comment on attachment 193979 [details] Patch Great.
WebKit Review Bot
Comment 6 2013-03-20 11:20:01 PDT
Comment on attachment 193979 [details] Patch Clearing flags on attachment: 193979 Committed r146365: <http://trac.webkit.org/changeset/146365>
WebKit Review Bot
Comment 7 2013-03-20 11:20:04 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.