aboutsummaryrefslogtreecommitdiffstats
path: root/test/suite/sputnik_converted/12_Statement/12.12_Labelled_Statements/S12.12_A1_T1.js
blob: c7a482a2bccd9b1088506b71e08b4a3a9745df07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright 2009 the Sputnik authors.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/**
 * @name: S12.12_A1_T1;
 * @section: 12.12;
 * @assertion: Labelled statements are only used in conjunction with labelled 
 * break and continue statements;
 * @description: Checking if labelled break works. See continue and break sections;
*/


// Converted for Test262 from original Sputnik source

ES5Harness.registerTest( {
id: "S12.12_A1_T1",

path: "TestCases/12_Statement/12.12_Labelled_Statements/S12.12_A1_T1.js",

assertion: "Labelled statements are only used in conjunction with labelled",

description: "Checking if labelled break works. See continue and break sections",

test: function testcase() {
   var object = {p1: 1, p2: 1};
var result = 0;
lbl: for(var i in object){
  result += object[i];
  break lbl;
}

if(!(result === 1)){
  $ERROR("'break label' should break execution of labelled iteration statement");
}

 }
});