Wed, 31 Dec 2014 07:53:36 +0100
Correct small whitespace inconsistency, lost while renaming variables.
michael@0 | 1 | // Copyright 2009 the Sputnik authors. All rights reserved. |
michael@0 | 2 | // This code is governed by the BSD license found in the LICENSE file. |
michael@0 | 3 | |
michael@0 | 4 | /** |
michael@0 | 5 | * When the [[Construct]] property for a Function object F is called: |
michael@0 | 6 | * A new native ECMAScript object is created. |
michael@0 | 7 | * Invoke the [[Call]] property of F, providing native ECMAScript object just created as the this value and |
michael@0 | 8 | * providing the argument list passed into [[Construct]] as the argument values |
michael@0 | 9 | * |
michael@0 | 10 | * @path ch13/13.2/S13.2.2_A5_T1.js |
michael@0 | 11 | * @description Declaring a function with "function __FACTORY(arg1, arg2)" |
michael@0 | 12 | */ |
michael@0 | 13 | |
michael@0 | 14 | __VOLUME=8; |
michael@0 | 15 | __RED="red"; |
michael@0 | 16 | __ID=12342; |
michael@0 | 17 | __TOP=1.1; |
michael@0 | 18 | __BOTTOM=0.0; |
michael@0 | 19 | __LEFT=0.0; |
michael@0 | 20 | |
michael@0 | 21 | |
michael@0 | 22 | function __FACTORY(arg1, arg2){ |
michael@0 | 23 | this.volume=__VOLUME; |
michael@0 | 24 | color=__RED; |
michael@0 | 25 | this.id=arg1; |
michael@0 | 26 | top=arg2; |
michael@0 | 27 | this.bottom=arguments[3]; |
michael@0 | 28 | left=arguments[4]; |
michael@0 | 29 | }; |
michael@0 | 30 | |
michael@0 | 31 | __device = new __FACTORY(__ID, __TOP, __BOTTOM, __LEFT); |
michael@0 | 32 | |
michael@0 | 33 | ////////////////////////////////////////////////////////////////////////////// |
michael@0 | 34 | //CHECK#1 |
michael@0 | 35 | if (__device.color !== undefined) { |
michael@0 | 36 | $ERROR('#1: __device.color === undefined. Actual: __device.color ==='+__device.color); |
michael@0 | 37 | } |
michael@0 | 38 | // |
michael@0 | 39 | ////////////////////////////////////////////////////////////////////////////// |
michael@0 | 40 | |
michael@0 | 41 | ////////////////////////////////////////////////////////////////////////////// |
michael@0 | 42 | //CHECK#2 |
michael@0 | 43 | if (__device.volume !== __VOLUME) { |
michael@0 | 44 | $ERROR('#2: __device.volume === __VOLUME. Actual: __device.volume ==='+__device.volume); |
michael@0 | 45 | } |
michael@0 | 46 | // |
michael@0 | 47 | ////////////////////////////////////////////////////////////////////////////// |
michael@0 | 48 | |
michael@0 | 49 | ////////////////////////////////////////////////////////////////////////////// |
michael@0 | 50 | //CHECK#3 |
michael@0 | 51 | if (__device.top !== undefined) { |
michael@0 | 52 | $ERROR('#3: __device.top === undefined. Actual: __device.top ==='+__device.top); |
michael@0 | 53 | } |
michael@0 | 54 | // |
michael@0 | 55 | ////////////////////////////////////////////////////////////////////////////// |
michael@0 | 56 | |
michael@0 | 57 | ////////////////////////////////////////////////////////////////////////////// |
michael@0 | 58 | //CHECK#4 |
michael@0 | 59 | if (__device.id !== __ID) { |
michael@0 | 60 | $ERROR('#4: __device.id === __ID. Actual: __device.id ==='+__device.id); |
michael@0 | 61 | } |
michael@0 | 62 | // |
michael@0 | 63 | ////////////////////////////////////////////////////////////////////////////// |
michael@0 | 64 | |
michael@0 | 65 | ////////////////////////////////////////////////////////////////////////////// |
michael@0 | 66 | //CHECK#5 |
michael@0 | 67 | if (__device.left !== undefined) { |
michael@0 | 68 | $ERROR('#5: __device.left === undefined. Actual: __device.left ==='+__device.left); |
michael@0 | 69 | } |
michael@0 | 70 | // |
michael@0 | 71 | ////////////////////////////////////////////////////////////////////////////// |
michael@0 | 72 | |
michael@0 | 73 | ////////////////////////////////////////////////////////////////////////////// |
michael@0 | 74 | //CHECK#6 |
michael@0 | 75 | if (__device.bottom !== __BOTTOM) { |
michael@0 | 76 | $ERROR('#6: __device.bottom === __BOTTOM. Actual: __device.bottom ==='+__device.bottom); |
michael@0 | 77 | } |
michael@0 | 78 | // |
michael@0 | 79 | ////////////////////////////////////////////////////////////////////////////// |
michael@0 | 80 |