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 Function object(F) is constructed the following steps from 9 to 11 take place michael@0: * 9.Create a new object as would be constructed by the expression new Object(). michael@0: * 10. Set the constructor property of Result(9) to F. This property is given attributes { DontEnum }. michael@0: * 11. Set the "prototype" property of F to Result(9). michael@0: * michael@0: * @path ch13/13.2/S13.2_A4_T1.js michael@0: * @description Checking prototype, prototype.constructor properties and {DontEnum} property of a constructor. michael@0: * Using "function __func(){}" as a FunctionDeclaration michael@0: */ michael@0: michael@0: function __func(){}; michael@0: michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: //CHECK#1 michael@0: if (typeof __func.prototype !== 'object') { michael@0: $ERROR('#1: typeof __func.prototype === \'object\'. Actual: typeof __gunc.prototype ==='+typeof __gunc.prototype); michael@0: } michael@0: // michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: //CHECK#2 michael@0: if (__func.prototype.constructor !== __func) { michael@0: $ERROR('#2: __func.prototype.constructor === __func. Actual: __gunc.prototype.constructor ==='+__gunc.prototype.constructor); michael@0: } michael@0: // michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: var __constructor_was__enumed; michael@0: michael@0: for (__prop in __func.prototype){ michael@0: if (__prop === 'constructor') michael@0: __constructor_was__enumed = true; michael@0: } michael@0: michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: //CHECK#3 michael@0: if (__constructor_was__enumed) { michael@0: $ERROR('#3: __constructor_was__enumed === false. Actual: __constructor_was__enumed ==='+__constructor_was__enumed); michael@0: } michael@0: // michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: