[webkit-reviews] review granted: [Bug 184474] [ESNext][BigInt] Implement support for "==" operation : [Attachment 339647] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed May 9 07:49:02 PDT 2018


Yusuke Suzuki <utatane.tea at gmail.com> has granted Caio Lima
<ticaiolima at gmail.com>'s request for review:
Bug 184474: [ESNext][BigInt] Implement support for "==" operation
https://bugs.webkit.org/show_bug.cgi?id=184474

Attachment 339647: Patch

https://bugs.webkit.org/attachment.cgi?id=339647&action=review




--- Comment #13 from Yusuke Suzuki <utatane.tea at gmail.com> ---
Comment on attachment 339647
  --> https://bugs.webkit.org/attachment.cgi?id=339647
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=339647&action=review

r=me

> Source/JavaScriptCore/runtime/JSBigInt.cpp:867
> +    uint64_t doubleBits = *(reinterpret_cast<uint64_t*>(&y));

Let's do `uint64_t doubleBits = bitwise_cast<uint64_t>(y);`.

> Source/JavaScriptCore/runtime/JSBigInt.cpp:886
> +    if (!y)
> +	   return x->isZero() ? ComparisonResult::Equal :
ComparisonResult::GreaterThan;

Adding `ASSERT(!xSign)` inside this `if` helps readers.


More information about the webkit-reviews mailing list