Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 /**
8 * File Name: label-001.js
9 * ECMA Section:
10 * Description: Labeled statements
11 *
12 * Labeled break and continue within a for loop.
13 *
14 *
15 * Author: christine@netscape.com
16 * Date: 11 August 1998
17 */
18 var SECTION = "label-003";
19 var VERSION = "ECMA_2";
20 var TITLE = "Labeled statements";
22 startTest();
23 writeHeaderToLog( SECTION + " "+ TITLE);
25 LabelTest(0, 0);
26 LabelTest(1, 1)
27 LabelTest(-1, 1000);
28 LabelTest(false, 0);
29 LabelTest(true, 1);
31 test();
33 function LabelTest( limit, expect) {
34 woo: for ( var result = 0; result < 1000; result++ ) { if (result == limit) { break woo; } else { continue woo; } };
36 new TestCase(
37 SECTION,
38 "break out of a labeled for loop: "+ limit,
39 expect,
40 result );
41 }