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: * Function's scope chain is started when it is declared michael@0: * michael@0: * @path ch13/13.2/S13.2.2_A19_T7.js michael@0: * @description Function is declared in the object scope as a variable michael@0: */ michael@0: michael@0: var a = 1; michael@0: michael@0: var __obj = {a:2}; michael@0: michael@0: with (__obj) michael@0: { michael@0: var __func = function() michael@0: { michael@0: return a; michael@0: } michael@0: } michael@0: michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: //CHECK#1 michael@0: if (__obj.hasOwnProperty('__func')) { michael@0: $ERROR('#1: __obj.hasOwnProperty(\'__func\') === false'); michael@0: } michael@0: // michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: ///////////////////////////////////// ///////////////////////////////////////// michael@0: //CHECK#2 michael@0: if (!(this.hasOwnProperty('__func'))) { michael@0: $ERROR('#2: this.hasOwnProperty(\'__func\') === true'); michael@0: } michael@0: // michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: //CHECK#3 michael@0: if (__func in __obj) { michael@0: $ERROR('#3: (__func in __obj) === false'); michael@0: } michael@0: // michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: //CHECK#4 michael@0: if (this.__func === undefined) { michael@0: $ERROR('#4: this.__func !== undefined'); michael@0: } michael@0: // michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: