| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
gTestfile = 'dowhile-001.js'; |
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 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 |
} |