]>
git.saurik.com Git - apple/javascriptcore.git/blob - tests/mozilla/ecma_2/Exceptions/date-004.js
3 Corresponds To: 15.9.5.4-2-n.js
4 ECMA Section: 15.9.5.4-1 Date.prototype.getTime
7 1. If the this value is not an object whose [[Class]] property is "Date",
8 generate a runtime error.
9 2. Return this time value.
10 Author: christine@netscape.com
11 Date: 12 november 1997
13 var SECTION
= "date-004";
14 var VERSION
= "JS1_4";
15 var TITLE
= "Date.prototype.getTime";
18 writeHeaderToLog( SECTION
+ " "+ TITLE
);
21 var testcases
= new Array();
23 var result
= "Failed";
24 var exception
= "No exception thrown";
25 var expect
= "Passed";
28 var MYDATE
= new MyDate();
29 result
= MYDATE
.getTime();
32 exception
= e
.toString();
35 testcases
[tc
++] = new TestCase(
37 "MYDATE = new MyDate(); MYDATE.getTime()" +
38 " (threw " + exception
+")",
44 function MyDate( value
) {
46 this.getTime
= Date
.prototype.getTime
;