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 | * Embedded syntax constructions of switch statement |
michael@0 | 6 | * |
michael@0 | 7 | * @path ch12/12.11/S12.11_A4_T1.js |
michael@0 | 8 | * @description Nesting one "switch" statement into StatementList of the other's |
michael@0 | 9 | */ |
michael@0 | 10 | |
michael@0 | 11 | function SwitchTest(value){ |
michael@0 | 12 | var result = 0; |
michael@0 | 13 | |
michael@0 | 14 | switch(value) { |
michael@0 | 15 | case 0: |
michael@0 | 16 | switch(value) { |
michael@0 | 17 | case 0: |
michael@0 | 18 | result += 3; |
michael@0 | 19 | break; |
michael@0 | 20 | default: |
michael@0 | 21 | result += 32; |
michael@0 | 22 | break; |
michael@0 | 23 | } |
michael@0 | 24 | result *= 2; |
michael@0 | 25 | break; |
michael@0 | 26 | result=3; |
michael@0 | 27 | default: |
michael@0 | 28 | result += 32; |
michael@0 | 29 | break; |
michael@0 | 30 | } |
michael@0 | 31 | return result; |
michael@0 | 32 | } |
michael@0 | 33 | |
michael@0 | 34 | var x = SwitchTest(0); |
michael@0 | 35 | if(x!==6) $ERROR("#1: SwitchTest(0) === 6. Actual: SwitchTest(0) ==="+ SwitchTest(0) ); |
michael@0 | 36 |