S15.9.3.2_A3_T1.1.js (1990B)
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 esid: sec-date-value 9 description: Test based on delete prototype.toString 10 includes: [dateConstants.js] 11 ---*/ 12 13 var x1 = new Date(date_1899_end); 14 15 assert.sameValue( 16 Object.prototype.toString.call(x1), 17 "[object Date]", 18 'Object.prototype.toString.call(new Date(date_1899_end)) must return "[object Date]"' 19 ); 20 21 var x2 = new Date(date_1900_start); 22 23 assert.sameValue( 24 Object.prototype.toString.call(x2), 25 "[object Date]", 26 'Object.prototype.toString.call(new Date(date_1900_start)) must return "[object Date]"' 27 ); 28 29 var x3 = new Date(date_1969_end); 30 31 assert.sameValue( 32 Object.prototype.toString.call(x3), 33 "[object Date]", 34 'Object.prototype.toString.call(new Date(date_1969_end)) must return "[object Date]"' 35 ); 36 37 var x4 = new Date(date_1970_start); 38 39 assert.sameValue( 40 Object.prototype.toString.call(x4), 41 "[object Date]", 42 'Object.prototype.toString.call(new Date(date_1970_start)) must return "[object Date]"' 43 ); 44 45 var x5 = new Date(date_1999_end); 46 47 assert.sameValue( 48 Object.prototype.toString.call(x5), 49 "[object Date]", 50 'Object.prototype.toString.call(new Date(date_1999_end)) must return "[object Date]"' 51 ); 52 53 var x6 = new Date(date_2000_start); 54 55 assert.sameValue( 56 Object.prototype.toString.call(x6), 57 "[object Date]", 58 'Object.prototype.toString.call(new Date(date_2000_start)) must return "[object Date]"' 59 ); 60 61 var x7 = new Date(date_2099_end); 62 63 assert.sameValue( 64 Object.prototype.toString.call(x7), 65 "[object Date]", 66 'Object.prototype.toString.call(new Date(date_2099_end)) must return "[object Date]"' 67 ); 68 69 var x8 = new Date(date_2100_start); 70 71 assert.sameValue( 72 Object.prototype.toString.call(x8), 73 "[object Date]", 74 'Object.prototype.toString.call(new Date(date_2100_start)) must return "[object Date]"' 75 ); 76 77 reportCompare(0, 0);