Changeset 231762 in webkit


Ignore:
Timestamp:
May 14, 2018 10:18:05 AM (6 years ago)
Author:
Yusuke Suzuki
Message:

[JSC] timeClip(-0) should produce +0
https://bugs.webkit.org/show_bug.cgi?id=185589

Reviewed by Saam Barati.

JSTests:

Fix several test262 failures.

  • stress/date-negative-zero.js: Added.

(shouldBe):

  • test262/expectations.yaml:

Source/WTF:

According to the spec[1], timeClip(-0) should produce +0.
We achieve this by adding 0.0 to the result of trunc(t).

[1]: https://tc39.github.io/ecma262/#sec-timeclip

  • wtf/DateMath.cpp:

(WTF::timeClip):

LayoutTests:

  • sputnik/Implementation_Diagnostics/S15.9.1.14_D1-expected.txt:
Location:
trunk
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r231742 r231762  
     12018-05-14  Yusuke Suzuki  <utatane.tea@gmail.com>
     2
     3        [JSC] timeClip(-0) should produce +0
     4        https://bugs.webkit.org/show_bug.cgi?id=185589
     5
     6        Reviewed by Saam Barati.
     7
     8        Fix several test262 failures.
     9
     10        * stress/date-negative-zero.js: Added.
     11        (shouldBe):
     12        * test262/expectations.yaml:
     13
    1142018-05-13  Caio Lima  <ticaiolima@gmail.com>
    215
  • trunk/JSTests/test262/expectations.yaml

    r231740 r231762  
    959959  default: 'Test262Error: Expected a TypeError but got a RangeError'
    960960  strict mode: 'Test262Error: Expected a TypeError but got a RangeError'
    961 test/built-ins/Date/TimeClip_negative_zero.js:
    962   default: 'Test262Error: TimeClip does not return negative zero Expected SameValue(«0», «0») to be true'
    963   strict mode: 'Test262Error: TimeClip does not return negative zero Expected SameValue(«0», «0») to be true'
    964961test/built-ins/Date/UTC/return-value.js:
    965962  default: 'Test262Error: 1970 Expected SameValue(«NaN», «0») to be true'
     
    974971  default: 'TypeError: Type error'
    975972  strict mode: 'TypeError: Type error'
    976 test/built-ins/Date/prototype/getTime/this-value-valid-date.js:
    977   default: 'Test262Error: -0 Expected SameValue(«0», «0») to be true'
    978   strict mode: 'Test262Error: -0 Expected SameValue(«0», «0») to be true'
    979973test/built-ins/Error/proto-from-ctor-realm.js:
    980974  default: 'Test262Error: Expected SameValue(«Error», «Error») to be true'
  • trunk/LayoutTests/ChangeLog

    r231752 r231762  
     12018-05-14  Yusuke Suzuki  <utatane.tea@gmail.com>
     2
     3        [JSC] timeClip(-0) should produce +0
     4        https://bugs.webkit.org/show_bug.cgi?id=185589
     5
     6        Reviewed by Saam Barati.
     7
     8        * sputnik/Implementation_Diagnostics/S15.9.1.14_D1-expected.txt:
     9
    1102018-05-14  Youenn Fablet  <youenn@apple.com>
    211
  • trunk/LayoutTests/sputnik/Implementation_Diagnostics/S15.9.1.14_D1-expected.txt

    r58534 r231762  
    11S15.9.1.14_D1
    22
    3 #1: TimeClip returns (ToInteger(value))
     3#1: TimeClip returns (ToInteger(value) + (+0))
    44PASS
    55
  • trunk/Source/WTF/ChangeLog

    r231760 r231762  
     12018-05-14  Yusuke Suzuki  <utatane.tea@gmail.com>
     2
     3        [JSC] timeClip(-0) should produce +0
     4        https://bugs.webkit.org/show_bug.cgi?id=185589
     5
     6        Reviewed by Saam Barati.
     7
     8        According to the spec[1], timeClip(-0) should produce +0.
     9        We achieve this by adding 0.0 to the result of trunc(t).
     10
     11        [1]: https://tc39.github.io/ecma262/#sec-timeclip
     12
     13        * wtf/DateMath.cpp:
     14        (WTF::timeClip):
     15
    1162018-05-13  Geoffrey Garen  <ggaren@apple.com>
    217
  • trunk/Source/WTF/wtf/DateMath.cpp

    r230774 r231762  
    11601160    if (fabs(t) > maxECMAScriptTime)
    11611161        return std::numeric_limits<double>::quiet_NaN();
    1162     return trunc(t);
     1162    return trunc(t) + 0.0;
    11631163}
    11641164
Note: See TracChangeset for help on using the changeset viewer.