S13.2.2_A3_T1.js (1387B)
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 When the [[Construct]] property for a Function object F is called: 7 A new native ECMAScript object is created. 8 It gets the value of the [[Prototype]] property of the F(Denote it PROTO_VAL). 9 If PROTO_VAL is not an object, sets the [[Prototype]] property of native ECMAScript object just created 10 to the original Object prototype object as described in 15.2.3.1 11 es5id: 13.2.2_A3_T1 12 description: Declaring a function with "function __FACTORY()" 13 ---*/ 14 15 function __FACTORY(){}; 16 __FACTORY.prototype=1; 17 18 ////////////////////////////////////////////////////////////////////////////// 19 //CHECK#1 20 if (typeof __FACTORY.prototype !== 'number') { 21 throw new Test262Error('#1: typeof __FACTORY.prototype === \'number\'. Actual: typeof __FACTORY.prototype ==='+(typeof __FACTORY.prototype)); 22 } 23 // 24 ////////////////////////////////////////////////////////////////////////////// 25 26 var __device = new __FACTORY(); 27 28 ////////////////////////////////////////////////////////////////////////////// 29 //CHECK#2 30 if (!(Object.prototype.isPrototypeOf(__device))) { 31 throw new Test262Error('#2: Object.prototype.isPrototypeOf(__device) === true'); 32 } 33 // 34 ////////////////////////////////////////////////////////////////////////////// 35 36 reportCompare(0, 0);