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 | * Code after ReturnStatement is not evaluated |
michael@0 | 6 | * |
michael@0 | 7 | * @path ch12/12.9/S12.9_A5.js |
michael@0 | 8 | * @description Using code after Return statement |
michael@0 | 9 | */ |
michael@0 | 10 | |
michael@0 | 11 | //CHECK#1 |
michael@0 | 12 | var x1=1; |
michael@0 | 13 | function myfunc1(){ |
michael@0 | 14 | x1++; |
michael@0 | 15 | return; |
michael@0 | 16 | x1*=2; |
michael@0 | 17 | } |
michael@0 | 18 | myfunc1(); |
michael@0 | 19 | if (x1!==2) $ERROR('#1: x1 === 2. Actual: x1 ==='+ x1 ); |
michael@0 | 20 | |
michael@0 | 21 | //CHECK#2 |
michael@0 | 22 | var x2=1; |
michael@0 | 23 | function myfunc2(){ |
michael@0 | 24 | x2++; |
michael@0 | 25 | return x2; |
michael@0 | 26 | x2*=2; |
michael@0 | 27 | } |
michael@0 | 28 | myfunc2(); |
michael@0 | 29 | if (x2!==2) $ERROR('#2: x2 === 2. Actual: x2 ==='+ x2 ); |
michael@0 | 30 | |
michael@0 | 31 | //CHECK#3 |
michael@0 | 32 | var x3=1; |
michael@0 | 33 | function myfunc3(){ |
michael@0 | 34 | x3++; |
michael@0 | 35 | return; |
michael@0 | 36 | return x3; |
michael@0 | 37 | x3*=2; |
michael@0 | 38 | } |
michael@0 | 39 | if (myfunc3()!==undefined) $ERROR('#3: myfunc3() === undefined. Actual: myfunc3() ==='+ myfunc3() ); |
michael@0 | 40 |