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: * Code after ReturnStatement is not evaluated michael@0: * michael@0: * @path ch12/12.9/S12.9_A5.js michael@0: * @description Using code after Return statement michael@0: */ michael@0: michael@0: //CHECK#1 michael@0: var x1=1; michael@0: function myfunc1(){ michael@0: x1++; michael@0: return; michael@0: x1*=2; michael@0: } michael@0: myfunc1(); michael@0: if (x1!==2) $ERROR('#1: x1 === 2. Actual: x1 ==='+ x1 ); michael@0: michael@0: //CHECK#2 michael@0: var x2=1; michael@0: function myfunc2(){ michael@0: x2++; michael@0: return x2; michael@0: x2*=2; michael@0: } michael@0: myfunc2(); michael@0: if (x2!==2) $ERROR('#2: x2 === 2. Actual: x2 ==='+ x2 ); michael@0: michael@0: //CHECK#3 michael@0: var x3=1; michael@0: function myfunc3(){ michael@0: x3++; michael@0: return; michael@0: return x3; michael@0: x3*=2; michael@0: } michael@0: if (myfunc3()!==undefined) $ERROR('#3: myfunc3() === undefined. Actual: myfunc3() ==='+ myfunc3() ); michael@0: