Debian Codegraph @

rhino/testsrc/tests/ecma_2/Statements/dowhile-001.js

raw symbols SCIP
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/. */
5
6 gTestfile = 'dowhile-001.js';
7
8 /**
9 * File Name: dowhile-001
10 * ECMA Section:
11 * Description: do...while statements
12 *
13 *
14 *
15 * Author: [email protected]
16 * Date: 11 August 1998
17 */
18 var SECTION = "dowhile-002";
19 var VERSION = "ECMA_2";
20 var TITLE = "do...while with a labeled continue statement";
21
22 startTest();
23 writeHeaderToLog( SECTION + " "+ TITLE);
24
25 LabeledContinue( 0, 1 );
26 LabeledContinue( 1, 1 );
27 LabeledContinue( -1, 1 );
28 LabeledContinue( 5, 5 );
29
30 test();
31
32 function LabeledContinue( limit, expect ) {
33 i = 0;
34 woohoo:
35 do {
36 i++;
37 continue woohoo;
38 } while ( i < limit );
39
40 new TestCase(
41 SECTION,
42 "do while ( " + i +" < " + limit +" )",
43 expect,
44 i );
45 }