S15.9.3.2_A2_T1.js (4613B)
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 [[Prototype]] property of the newly constructed object 7 is set to the original Date prototype object, the one that is the 8 initial value of Date.prototype 9 esid: sec-date-value 10 description: Checking Date.prototype property of newly constructed objects 11 includes: [dateConstants.js] 12 ---*/ 13 14 var x11 = new Date(date_1899_end); 15 16 assert.sameValue( 17 typeof x11.constructor.prototype, 18 "object", 19 'The value of `typeof x11.constructor.prototype` is expected to be "object"' 20 ); 21 22 var x12 = new Date(date_1899_end); 23 assert(Date.prototype.isPrototypeOf(x12), 'Date.prototype.isPrototypeOf(x12) must return true'); 24 25 var x13 = new Date(date_1899_end); 26 27 assert.sameValue( 28 Date.prototype, 29 x13.constructor.prototype, 30 'The value of Date.prototype is expected to equal the value of x13.constructor.prototype' 31 ); 32 33 var x21 = new Date(date_1900_start); 34 35 assert.sameValue( 36 typeof x21.constructor.prototype, 37 "object", 38 'The value of `typeof x21.constructor.prototype` is expected to be "object"' 39 ); 40 41 var x22 = new Date(date_1900_start); 42 assert(Date.prototype.isPrototypeOf(x22), 'Date.prototype.isPrototypeOf(x22) must return true'); 43 44 var x23 = new Date(date_1900_start); 45 46 assert.sameValue( 47 Date.prototype, 48 x23.constructor.prototype, 49 'The value of Date.prototype is expected to equal the value of x23.constructor.prototype' 50 ); 51 52 var x31 = new Date(date_1969_end); 53 54 assert.sameValue( 55 typeof x31.constructor.prototype, 56 "object", 57 'The value of `typeof x31.constructor.prototype` is expected to be "object"' 58 ); 59 60 var x32 = new Date(date_1969_end); 61 assert(Date.prototype.isPrototypeOf(x32), 'Date.prototype.isPrototypeOf(x32) must return true'); 62 63 var x33 = new Date(date_1969_end); 64 65 assert.sameValue( 66 Date.prototype, 67 x33.constructor.prototype, 68 'The value of Date.prototype is expected to equal the value of x33.constructor.prototype' 69 ); 70 71 var x41 = new Date(date_1970_start); 72 73 assert.sameValue( 74 typeof x41.constructor.prototype, 75 "object", 76 'The value of `typeof x41.constructor.prototype` is expected to be "object"' 77 ); 78 79 var x42 = new Date(date_1970_start); 80 assert(Date.prototype.isPrototypeOf(x42), 'Date.prototype.isPrototypeOf(x42) must return true'); 81 82 var x43 = new Date(date_1970_start); 83 84 assert.sameValue( 85 Date.prototype, 86 x43.constructor.prototype, 87 'The value of Date.prototype is expected to equal the value of x43.constructor.prototype' 88 ); 89 90 var x51 = new Date(date_1999_end); 91 92 assert.sameValue( 93 typeof x51.constructor.prototype, 94 "object", 95 'The value of `typeof x51.constructor.prototype` is expected to be "object"' 96 ); 97 98 var x52 = new Date(date_1999_end); 99 assert(Date.prototype.isPrototypeOf(x52), 'Date.prototype.isPrototypeOf(x52) must return true'); 100 101 var x53 = new Date(date_1999_end); 102 103 assert.sameValue( 104 Date.prototype, 105 x53.constructor.prototype, 106 'The value of Date.prototype is expected to equal the value of x53.constructor.prototype' 107 ); 108 109 var x61 = new Date(date_2000_start); 110 111 assert.sameValue( 112 typeof x61.constructor.prototype, 113 "object", 114 'The value of `typeof x61.constructor.prototype` is expected to be "object"' 115 ); 116 117 var x62 = new Date(date_2000_start); 118 assert(Date.prototype.isPrototypeOf(x62), 'Date.prototype.isPrototypeOf(x62) must return true'); 119 120 var x63 = new Date(date_2000_start); 121 122 assert.sameValue( 123 Date.prototype, 124 x63.constructor.prototype, 125 'The value of Date.prototype is expected to equal the value of x63.constructor.prototype' 126 ); 127 128 var x71 = new Date(date_2099_end); 129 130 assert.sameValue( 131 typeof x71.constructor.prototype, 132 "object", 133 'The value of `typeof x71.constructor.prototype` is expected to be "object"' 134 ); 135 136 var x72 = new Date(date_2099_end); 137 assert(Date.prototype.isPrototypeOf(x72), 'Date.prototype.isPrototypeOf(x72) must return true'); 138 139 var x73 = new Date(date_2099_end); 140 141 assert.sameValue( 142 Date.prototype, 143 x73.constructor.prototype, 144 'The value of Date.prototype is expected to equal the value of x73.constructor.prototype' 145 ); 146 147 var x81 = new Date(date_2100_start); 148 149 assert.sameValue( 150 typeof x81.constructor.prototype, 151 "object", 152 'The value of `typeof x81.constructor.prototype` is expected to be "object"' 153 ); 154 155 var x82 = new Date(date_2100_start); 156 assert(Date.prototype.isPrototypeOf(x82), 'Date.prototype.isPrototypeOf(x82) must return true'); 157 158 var x83 = new Date(date_2100_start); 159 160 assert.sameValue( 161 Date.prototype, 162 x83.constructor.prototype, 163 'The value of Date.prototype is expected to equal the value of x83.constructor.prototype' 164 ); 165 166 reportCompare(0, 0);