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: * Gets the value of the [[Prototype]] property of the F(Denote it PROTO_VAL). michael@0: * If PROTO_VAL is an object, sets the [[Prototype]] property of native ECMAScript object just created michael@0: * to the PROTO_VAL michael@0: * michael@0: * @path ch13/13.2/S13.2.2_A4_T1.js michael@0: * @description Declaring a function with "function __FACTORY()" michael@0: */ michael@0: michael@0: var __CUBE="cube"; michael@0: michael@0: function __FACTORY(){ michael@0: }; michael@0: __FACTORY.prototype={ shape:__CUBE, printShape:function(){return this.shape;} }; michael@0: michael@0: var __device = new __FACTORY(); michael@0: michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: //CHECK#1 michael@0: if (__device.printShape === undefined) { michael@0: $ERROR('#1: __device.printShape !== undefined. Actual: __device.printShape ==='+__device.printShape); michael@0: } michael@0: // michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: //CHECK#2 michael@0: if (__device.printShape() !== __CUBE) { michael@0: $ERROR('#2: __device.printShape() === __CUBE. Actual: __device.printShape() ==='+__device.printShape()); michael@0: } michael@0: // michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: