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 [[Call]] property for a Function object F is called, the following steps are taken: michael@0: * 2. Evaluate F's FunctionBody; michael@0: * if Result.type is returned then Result.value is returned too michael@0: * michael@0: * @path ch13/13.2/S13.2.1_A7_T3.js michael@0: * @description Returning number. Declaring a function with "function __func()" michael@0: */ michael@0: michael@0: function __func(){ michael@0: x = 1; michael@0: return x; michael@0: } michael@0: michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: //CHECK# michael@0: try { michael@0: x=x; michael@0: $ERROR('#0: "x=x" lead to throwing exception'); michael@0: } catch (e) { michael@0: if (e instanceof Test262Error) throw e; michael@0: } michael@0: // michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: //CHECK#1 michael@0: try{ michael@0: var __x=__func(); michael@0: } catch(e){ michael@0: $ERROR('#1: var __x=__func() does not lead to throwing exception. Actual: exception is '+e); michael@0: } michael@0: // michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: //CHECK#2 michael@0: if (__x !== 1) { michael@0: $ERROR('#2: __x === 1. Actual: __x ==='+__x); michael@0: } michael@0: // michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: //CHECK#3 michael@0: if (x !== 1) { michael@0: $ERROR('#3: x === 1. Actual: x ==='+x); michael@0: } michael@0: // michael@0: ////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: