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: * Invoke the [[Call]] property of F, providing native ECMAScript object just created as the this value and michael@0: * providing the argument list passed into [[Construct]] as the argument values michael@0: * michael@0: * @path ch13/13.2/S13.2.2_A5_T1.js michael@0: * @description Declaring a function with "function __FACTORY(arg1, arg2)" michael@0: */ michael@0: michael@0: __VOLUME=8; michael@0: __RED="red"; michael@0: __ID=12342; michael@0: __TOP=1.1; michael@0: __BOTTOM=0.0; michael@0: __LEFT=0.0; michael@0: michael@0: michael@0: function __FACTORY(arg1, arg2){ michael@0: this.volume=__VOLUME; michael@0: color=__RED; michael@0: this.id=arg1; michael@0: top=arg2; michael@0: this.bottom=arguments[3]; michael@0: left=arguments[4]; michael@0: }; michael@0: michael@0: __device = new __FACTORY(__ID, __TOP, __BOTTOM, __LEFT); michael@0: michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: //CHECK#1 michael@0: if (__device.color !== undefined) { michael@0: $ERROR('#1: __device.color === undefined. Actual: __device.color ==='+__device.color); michael@0: } michael@0: // michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: //CHECK#2 michael@0: if (__device.volume !== __VOLUME) { michael@0: $ERROR('#2: __device.volume === __VOLUME. Actual: __device.volume ==='+__device.volume); michael@0: } michael@0: // michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: //CHECK#3 michael@0: if (__device.top !== undefined) { michael@0: $ERROR('#3: __device.top === undefined. Actual: __device.top ==='+__device.top); michael@0: } michael@0: // michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: //CHECK#4 michael@0: if (__device.id !== __ID) { michael@0: $ERROR('#4: __device.id === __ID. Actual: __device.id ==='+__device.id); michael@0: } michael@0: // michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: //CHECK#5 michael@0: if (__device.left !== undefined) { michael@0: $ERROR('#5: __device.left === undefined. Actual: __device.left ==='+__device.left); michael@0: } michael@0: // michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: //CHECK#6 michael@0: if (__device.bottom !== __BOTTOM) { michael@0: $ERROR('#6: __device.bottom === __BOTTOM. Actual: __device.bottom ==='+__device.bottom); michael@0: } michael@0: // michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: