Changeset 41896 in webkit


Ignore:
Timestamp:
Mar 21, 2009 8:01:59 PM (15 years ago)
Author:
cwzwarich@webkit.org
Message:

2009-03-21 Cameron Zwarich <cwzwarich@uwaterloo.ca>

Reviewed by Oliver Hunt.

Bug 20049: testapi failure: MyObject - 0 should be NaN but instead is 1.
<https://bugs.webkit.org/show_bug.cgi?id=20049>
<rdar://problem/6079127>

In this case, the test is wrong. According to the ECMA spec, subtraction
uses ToNumber, not ToPrimitive. Change the test to match the spec.

  • API/tests/testapi.js:
Location:
trunk/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/API/tests/testapi.js

    r41893 r41896  
    115115shouldBe("(MyObject.toString())", "[object MyObject]"); // toString
    116116shouldBe("String(MyObject)", "MyObjectAsString"); // type conversion to string
    117 shouldBe("MyObject - 0", NaN); // toPrimitive
     117shouldBe("MyObject - 0", 1); // toNumber
    118118
    119119shouldBe("typeof MyConstructor", "object");
  • trunk/JavaScriptCore/ChangeLog

    r41895 r41896  
     12009-03-21  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
     2
     3        Reviewed by Oliver Hunt.
     4
     5        Bug 20049: testapi failure: MyObject - 0 should be NaN but instead is 1.
     6        <https://bugs.webkit.org/show_bug.cgi?id=20049>
     7        <rdar://problem/6079127>
     8
     9        In this case, the test is wrong. According to the ECMA spec, subtraction
     10        uses ToNumber, not ToPrimitive. Change the test to match the spec.
     11
     12        * API/tests/testapi.js:
     13
    1142009-03-21  Oliver Hunt  <oliver@apple.com>
    215
Note: See TracChangeset for help on using the changeset viewer.