Wed, 31 Dec 2014 13:27:57 +0100
Ignore runtime configuration files generated during quality assurance.
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 Function object(F) is constructed the following steps from 9 to 11 take place |
michael@0 | 6 | * 9.Create a new object as would be constructed by the expression new Object(). |
michael@0 | 7 | * 10. Set the constructor property of Result(9) to F. This property is given attributes { DontEnum }. |
michael@0 | 8 | * 11. Set the "prototype" property of F to Result(9). |
michael@0 | 9 | * |
michael@0 | 10 | * @path ch13/13.2/S13.2_A4_T1.js |
michael@0 | 11 | * @description Checking prototype, prototype.constructor properties and {DontEnum} property of a constructor. |
michael@0 | 12 | * Using "function __func(){}" as a FunctionDeclaration |
michael@0 | 13 | */ |
michael@0 | 14 | |
michael@0 | 15 | function __func(){}; |
michael@0 | 16 | |
michael@0 | 17 | ////////////////////////////////////////////////////////////////////////////// |
michael@0 | 18 | //CHECK#1 |
michael@0 | 19 | if (typeof __func.prototype !== 'object') { |
michael@0 | 20 | $ERROR('#1: typeof __func.prototype === \'object\'. Actual: typeof __gunc.prototype ==='+typeof __gunc.prototype); |
michael@0 | 21 | } |
michael@0 | 22 | // |
michael@0 | 23 | ////////////////////////////////////////////////////////////////////////////// |
michael@0 | 24 | |
michael@0 | 25 | ////////////////////////////////////////////////////////////////////////////// |
michael@0 | 26 | //CHECK#2 |
michael@0 | 27 | if (__func.prototype.constructor !== __func) { |
michael@0 | 28 | $ERROR('#2: __func.prototype.constructor === __func. Actual: __gunc.prototype.constructor ==='+__gunc.prototype.constructor); |
michael@0 | 29 | } |
michael@0 | 30 | // |
michael@0 | 31 | ////////////////////////////////////////////////////////////////////////////// |
michael@0 | 32 | |
michael@0 | 33 | var __constructor_was__enumed; |
michael@0 | 34 | |
michael@0 | 35 | for (__prop in __func.prototype){ |
michael@0 | 36 | if (__prop === 'constructor') |
michael@0 | 37 | __constructor_was__enumed = true; |
michael@0 | 38 | } |
michael@0 | 39 | |
michael@0 | 40 | ////////////////////////////////////////////////////////////////////////////// |
michael@0 | 41 | //CHECK#3 |
michael@0 | 42 | if (__constructor_was__enumed) { |
michael@0 | 43 | $ERROR('#3: __constructor_was__enumed === false. Actual: __constructor_was__enumed ==='+__constructor_was__enumed); |
michael@0 | 44 | } |
michael@0 | 45 | // |
michael@0 | 46 | ////////////////////////////////////////////////////////////////////////////// |
michael@0 | 47 | |
michael@0 | 48 | |
michael@0 | 49 | |
michael@0 | 50 | |
michael@0 | 51 | |
michael@0 | 52 |