keith_miller@apple.com | bcc77f2 | 2016-07-15 06:03:25 +0000 | [diff] [blame] | 1 | // Copyright 2009 the Sputnik authors. All rights reserved. |
| 2 | // This code is governed by the BSD license found in the LICENSE file. |
| 3 | |
| 4 | /*--- |
| 5 | info: > |
| 6 | The [[Class]] property of the newly constructed object |
| 7 | is set to "Date" |
| 8 | es5id: 15.9.3.1_A3_T4.1 |
| 9 | description: > |
| 10 | Test based on delete prototype.toString - 5 arguments, (year, |
| 11 | month, date, hours, minutes) |
| 12 | ---*/ |
| 13 | |
| 14 | var x1 = new Date(1899, 11, 31, 23, 59); |
| 15 | if (Object.prototype.toString.call(x1) !== "[object Date]") { |
| 16 | $ERROR("#1: The [[Class]] property of the newly constructed object is set to 'Date'"); |
| 17 | } |
| 18 | |
| 19 | var x2 = new Date(1899, 12, 1, 0, 0); |
| 20 | if (Object.prototype.toString.call(x2) !== "[object Date]") { |
| 21 | $ERROR("#2: The [[Class]] property of the newly constructed object is set to 'Date'"); |
| 22 | } |
| 23 | |
| 24 | var x3 = new Date(1900, 0, 1, 0, 0); |
| 25 | if (Object.prototype.toString.call(x3) !== "[object Date]") { |
| 26 | $ERROR("#3: The [[Class]] property of the newly constructed object is set to 'Date'"); |
| 27 | } |
| 28 | |
| 29 | var x4 = new Date(1969, 11, 31, 23, 59); |
| 30 | if (Object.prototype.toString.call(x4) !== "[object Date]") { |
| 31 | $ERROR("#4: The [[Class]] property of the newly constructed object is set to 'Date'"); |
| 32 | } |
| 33 | |
| 34 | var x5 = new Date(1969, 12, 1, 0, 0); |
| 35 | if (Object.prototype.toString.call(x5) !== "[object Date]") { |
| 36 | $ERROR("#5: The [[Class]] property of the newly constructed object is set to 'Date'"); |
| 37 | } |
| 38 | |
| 39 | var x6 = new Date(1970, 0, 1, 0, 0); |
| 40 | if (Object.prototype.toString.call(x6) !== "[object Date]") { |
| 41 | $ERROR("#6: The [[Class]] property of the newly constructed object is set to 'Date'"); |
| 42 | } |
| 43 | |
| 44 | var x7 = new Date(1999, 11, 31, 23, 59); |
| 45 | if (Object.prototype.toString.call(x7) !== "[object Date]") { |
| 46 | $ERROR("#7: The [[Class]] property of the newly constructed object is set to 'Date'"); |
| 47 | } |
| 48 | |
| 49 | var x8 = new Date(1999, 12, 1, 0, 0); |
| 50 | if (Object.prototype.toString.call(x8) !== "[object Date]") { |
| 51 | $ERROR("#8: The [[Class]] property of the newly constructed object is set to 'Date'"); |
| 52 | } |
| 53 | |
| 54 | var x9 = new Date(2000, 0, 1, 0, 0); |
| 55 | if (Object.prototype.toString.call(x9) !== "[object Date]") { |
| 56 | $ERROR("#9: The [[Class]] property of the newly constructed object is set to 'Date'"); |
| 57 | } |
| 58 | |
| 59 | var x10 = new Date(2099, 11, 31, 23, 59); |
| 60 | if (Object.prototype.toString.call(x10) !== "[object Date]") { |
| 61 | $ERROR("#10: The [[Class]] property of the newly constructed object is set to 'Date'"); |
| 62 | } |
| 63 | |
| 64 | var x11 = new Date(2099, 12, 1, 0, 0); |
| 65 | if (Object.prototype.toString.call(x11) !== "[object Date]") { |
| 66 | $ERROR("#11: The [[Class]] property of the newly constructed object is set to 'Date'"); |
| 67 | } |
| 68 | |
| 69 | var x12 = new Date(2100, 0, 1, 0, 0); |
| 70 | if (Object.prototype.toString.call(x12) !== "[object Date]") { |
| 71 | $ERROR("#12: The [[Class]] property of the newly constructed object is set to 'Date'"); |
| 72 | } |