Changeset 41896 in webkit for trunk/JavaScriptCore/API


Ignore:
Timestamp:
Mar 21, 2009, 8:01:59 PM (16 years ago)
Author:
[email protected]
Message:

2009-03-21 Cameron Zwarich <[email protected]>

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:
File:
1 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");
Note: See TracChangeset for help on using the changeset viewer.