michael@0: // Copyright 2009 the Sputnik authors. All rights reserved. michael@0: // This code is governed by the BSD license found in the LICENSE file. michael@0: michael@0: /** michael@0: * When the [[Construct]] property for a Function object F is called: michael@0: * A new native ECMAScript object is created. michael@0: * It gets the value of the [[Prototype]] property of the F(Denote it PROTO_VAL). michael@0: * If PROTO_VAL is not an object, sets the [[Prototype]] property of native ECMAScript object just created michael@0: * to the original Object prototype object as described in 15.2.3.1 michael@0: * michael@0: * @path ch13/13.2/S13.2.2_A3_T1.js michael@0: * @description Declaring a function with "function __FACTORY()" michael@0: */ michael@0: michael@0: function __FACTORY(){}; michael@0: __FACTORY.prototype=1; michael@0: michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: //CHECK#1 michael@0: if (typeof __FACTORY.prototype !== 'number') { michael@0: $ERROR('#1: typeof __FACTORY.prototype === \'number\'. Actual: typeof __FACTORY.prototype ==='+(typeof __FACTORY.prototype)); michael@0: } michael@0: // michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: var __device = new __FACTORY(); michael@0: michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: //CHECK#2 michael@0: if (!(Object.prototype.isPrototypeOf(__device))) { michael@0: $ERROR('#2: Object.prototype.isPrototypeOf(__device) === true'); michael@0: } michael@0: // michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: