1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/tests/test262/ch12/12.12/S12.12_A1_T1.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,22 @@ 1.4 +// Copyright 2009 the Sputnik authors. All rights reserved. 1.5 +// This code is governed by the BSD license found in the LICENSE file. 1.6 + 1.7 +/** 1.8 + * Labelled statements are only used in conjunction with labelled 1.9 + * break and continue statements 1.10 + * 1.11 + * @path ch12/12.12/S12.12_A1_T1.js 1.12 + * @description Checking if labelled break works. See continue and break sections 1.13 + */ 1.14 + 1.15 +var object = {p1: 1, p2: 1}; 1.16 +var result = 0; 1.17 +lbl: for(var i in object){ 1.18 + result += object[i]; 1.19 + break lbl; 1.20 +} 1.21 + 1.22 +if(!(result === 1)){ 1.23 + $ERROR("'break label' should break execution of labelled iteration statement"); 1.24 +} 1.25 +