1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/tests/test262/ch13/13.2/S13.2.2_A3_T1.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,35 @@ 1.4 +// Copyright 2009 the Sputnik authors. All rights reserved. 1.5 +// This code is governed by the BSD license found in the LICENSE file. 1.6 + 1.7 +/** 1.8 + * When the [[Construct]] property for a Function object F is called: 1.9 + * A new native ECMAScript object is created. 1.10 + * It gets the value of the [[Prototype]] property of the F(Denote it PROTO_VAL). 1.11 + * If PROTO_VAL is not an object, sets the [[Prototype]] property of native ECMAScript object just created 1.12 + * to the original Object prototype object as described in 15.2.3.1 1.13 + * 1.14 + * @path ch13/13.2/S13.2.2_A3_T1.js 1.15 + * @description Declaring a function with "function __FACTORY()" 1.16 + */ 1.17 + 1.18 +function __FACTORY(){}; 1.19 +__FACTORY.prototype=1; 1.20 + 1.21 +////////////////////////////////////////////////////////////////////////////// 1.22 +//CHECK#1 1.23 +if (typeof __FACTORY.prototype !== 'number') { 1.24 + $ERROR('#1: typeof __FACTORY.prototype === \'number\'. Actual: typeof __FACTORY.prototype ==='+(typeof __FACTORY.prototype)); 1.25 +} 1.26 +// 1.27 +////////////////////////////////////////////////////////////////////////////// 1.28 + 1.29 +var __device = new __FACTORY(); 1.30 + 1.31 +////////////////////////////////////////////////////////////////////////////// 1.32 +//CHECK#2 1.33 +if (!(Object.prototype.isPrototypeOf(__device))) { 1.34 + $ERROR('#2: Object.prototype.isPrototypeOf(__device) === true'); 1.35 +} 1.36 +// 1.37 +////////////////////////////////////////////////////////////////////////////// 1.38 +