]> git.saurik.com Git - apple/javascriptcore.git/blob - tests/mozilla/ecma_2/Statements/dowhile-001.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / mozilla / ecma_2 / Statements / dowhile-001.js
1 /**
2 * File Name: dowhile-001
3 * ECMA Section:
4 * Description: do...while statements
5 *
6 *
7 *
8 * Author: christine@netscape.com
9 * Date: 11 August 1998
10 */
11 var SECTION = "dowhile-002";
12 var VERSION = "ECMA_2";
13 var TITLE = "do...while with a labeled continue statement";
14
15 startTest();
16 writeHeaderToLog( SECTION + " "+ TITLE);
17
18 var tc = 0;
19 var testcases = new Array();
20
21 LabeledContinue( 0, 1 );
22 LabeledContinue( 1, 1 );
23 LabeledContinue( -1, 1 );
24 LabeledContinue( 5, 5 );
25
26 test();
27
28 function LabeledContinue( limit, expect ) {
29 i = 0;
30 woohoo:
31 do {
32 i++;
33 continue woohoo;
34 } while ( i < limit );
35
36 testcases[tc++] = new TestCase(
37 SECTION,
38 "do while ( " + i +" < " + limit +" )",
39 expect,
40 i );
41 }