Status: New
Owner: ----

New issue 2135 by [email protected]: Date.setHours returns Date instance instead of getTime
http://code.google.com/p/v8/issues/detail?id=2135

Transferred from http://code.google.com/p/chromium/issues/detail?id=128315


What steps will reproduce the problem?
1. Open console
2. Type
var a = new Date(0).setHours(0,0,0,0)
3. a is a date instance which is wrong. It must be time in milliseconds (-7200000)

What is the expected result?
-7200000

What happens instead?
Date instance corresponding to
Thu Jan 01 1970 00:00:00 GMT+0200 (FLE Standard Time)


---------------------------------------------------------------
Chrome Version: 19.0.1084.46 m
OS Version    : Any
URLs : Any URL. For fun try javascript:alert(new Date(0).setHours(0,0,0,0))

Behaviour in other browsers tested:
Add OK or FAIL after other browsers where you have tested this issue:
 Safari 5.1.7: OK
 Firefox 12.0: OK
     IE 7/8/9: OK
  Chrome 18.x: OK
        Opera: OK
---------------------------------------------------------------

Have a look at the ECMA Script documentation, 3rd edition
http://www.ecma-international.org/publications/files/ECMA-ST-ARCH/ECMA-262,%203rd%20edition,%20December%201999.pdf

Section 15.9.5.35, page 139

Specifically - point 9 - 9. Return the value of the [[Value]] property of the this value.


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to