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/. */
9
Description: 'Tests the break statement'
15
var SECTION = 'As described in Netscape doc "Whats new in JavaScript 1.2"';
16
var VERSION = 'no version';
18
var TITLE = 'statements: break';
20
writeHeaderToLog("Executing script: break.js");
21
writeHeaderToLog( SECTION + " "+ TITLE);
25
for (i = 0; i < 1000; i++)
30
// 'breaking out of "for" loop'
31
new TestCase ( SECTION, 'breaking out of "for" loop',
37
for (i = 0; i < 1000; i++)
42
for (j = 0; j < 1000; j++)
44
if (j == 500) break out1;
51
// 'breaking out of a "for" loop with a "label"'
52
new TestCase ( SECTION, 'breaking out of a "for" loop with a "label"',
63
// 'breaking out of a "while" loop'
64
new TestCase ( SECTION, 'breaking out of a "while" loop',
80
if (j == 500) break out3;
89
// 'breaking out of a "while" loop with a "label"'
90
new TestCase ( SECTION, 'breaking out of a "while" loop with a "label"',
101
// 'breaking out of a "do" loop'
102
new TestCase ( SECTION, 'breaking out of a "do" loop',
117
if (j == 500) break out5;
126
// 'breaking out of a "do" loop with a "label"'
127
new TestCase ( SECTION, 'breaking out of a "do" loop with a "label"',