Wed, 31 Dec 2014 07:53:36 +0100
Correct small whitespace inconsistency, lost while renaming variables.
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 | * Labelled statements are only used in conjunction with labelled |
michael@0 | 6 | * break and continue statements |
michael@0 | 7 | * |
michael@0 | 8 | * @path ch12/12.12/S12.12_A1_T1.js |
michael@0 | 9 | * @description Checking if labelled break works. See continue and break sections |
michael@0 | 10 | */ |
michael@0 | 11 | |
michael@0 | 12 | var object = {p1: 1, p2: 1}; |
michael@0 | 13 | var result = 0; |
michael@0 | 14 | lbl: for(var i in object){ |
michael@0 | 15 | result += object[i]; |
michael@0 | 16 | break lbl; |
michael@0 | 17 | } |
michael@0 | 18 | |
michael@0 | 19 | if(!(result === 1)){ |
michael@0 | 20 | $ERROR("'break label' should break execution of labelled iteration statement"); |
michael@0 | 21 | } |
michael@0 | 22 |