[webkit-reviews] review denied: [Bug 67980] [Chromium/Mac] fast/events/constructors/progress-event-constructor.html is failing : [Attachment 112459] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Oct 26 09:48:22 PDT 2011
Adam Barth <abarth at webkit.org> has denied Kentaro Hara <haraken at chromium.org>'s
request for review:
Bug 67980: [Chromium/Mac]
fast/events/constructors/progress-event-constructor.html is failing
https://bugs.webkit.org/show_bug.cgi?id=67980
Attachment 112459: Patch
https://bugs.webkit.org/attachment.cgi?id=112459&action=review
------- Additional Comments from Adam Barth <abarth at webkit.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=112459&action=review
> Source/WebCore/bindings/v8/OptionsObject.cpp:238
> + // Calculate d % 2^{64}.
> + // -2^{64} < fmodValue < 2^{64}.
> + double fmodValue = fmod(trunc(d), std::numeric_limits<unsigned long
long>::max() + 1.0);
> + if (fmodValue >= 0) {
> + // 0 <= fmodValue < 2^{64}.
> + // 0 <= value < 2^{64}. This cast causes no loss.
> + value = static_cast<unsigned long long>(fmodValue);
> + } else {
> + // -2^{64} < fmodValue < 0.
> + // 0 < fmodValueInUnsignedLongLong < 2^{64}. This cast causes no
loss.
> + unsigned long long fmodValueInUnsignedLongLong =
static_cast<unsigned long long>(-fmodValue);
> + // -1 < (std::numeric_limits<unsigned long long>::max() -
fmodValueInUnsignedLongLong) < 2^{64} - 1.
> + // 0 < value < 2^{64}.
> + value = std::numeric_limits<unsigned long long>::max() -
fmodValueInUnsignedLongLong + 1;
> + }
This looks cool, but it should be factored into a more general location so that
folks can re-use it. If it's V8-specific logic, it should probably go in
V8Utilities. If it's more general than V8, it should go in WTF somewhere.
More information about the webkit-reviews
mailing list