]>
git.saurik.com Git - apple/javascriptcore.git/blob - tests/mozilla/ecma_2/Exceptions/date-002.js
3 Corresponds To: 15.9.5.23-3-n.js
4 ECMA Section: 15.9.5.23
5 Description: Date.prototype.setTime
7 1. If the this value is not a Date object, generate a runtime error.
8 2. Call ToNumber(time).
9 3. Call TimeClip(Result(1)).
10 4. Set the [[Value]] property of the this value to Result(2).
11 5. Return the value of the [[Value]] property of the this value.
13 Author: christine@netscape.com
14 Date: 12 november 1997
16 var SECTION
= "date-002";
17 var VERSION
= "JS1_4";
18 var TITLE
= "Date.prototype.setTime()";
21 writeHeaderToLog( SECTION
+ " "+ TITLE
);
24 var testcases
= new Array();
26 var result
= "Failed";
27 var exception
= "No exception thrown";
28 var expect
= "Passed";
31 var MYDATE
= new MyDate();
32 result
= MYDATE
.setTime(0);
35 exception
= e
.toString();
38 testcases
[tc
++] = new TestCase(
40 "MYDATE = new MyDate(); MYDATE.setTime(0)" +
41 " (threw " + exception
+")",
47 function MyDate(value
) {
49 this.setTime
= Date
.prototype.setTime
;