mirror of https://github.com/tc39/test262.git
parent
8e2a07d2e1
commit
e227f54d01
|
@ -9,15 +9,15 @@ es5id: 12.6.1_A4_T5
|
||||||
description: Using labeled "break" in order to continue a loop
|
description: Using labeled "break" in order to continue a loop
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//CHECK#1
|
var i = 0;
|
||||||
var i=0;
|
|
||||||
woohoo:{
|
woohoo:{
|
||||||
do{
|
do {
|
||||||
i++;
|
i++;
|
||||||
if ( ! (i < 10) ) {
|
if ( i == 10 ) {
|
||||||
break woohoo;
|
break woohoo;
|
||||||
$ERROR('#1.1: "break woohoo" must break loop');
|
throw new Test262Error('#1.1: "break woohoo" must break loop');
|
||||||
}
|
}
|
||||||
} while ( true );
|
} while ( true );
|
||||||
if (i!==10) $ERROR('#1.2: i===10. Actual: i==='+ i );
|
throw new Test262Error('This code should be unreacheable');
|
||||||
}
|
}
|
||||||
|
assert.sameValue(i, 10);
|
||||||
|
|
|
@ -10,14 +10,15 @@ description: Using labeled "break" in order to continue a "while" loop
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
var i=0;
|
var i = 0;
|
||||||
woohoo:{
|
woohoo:{
|
||||||
while(true){
|
while(true){
|
||||||
i++;
|
i++;
|
||||||
if ( ! (i < 10) ) {
|
if ( i == 10 ) {
|
||||||
break woohoo;
|
break woohoo;
|
||||||
$ERROR('#1.1: "break woohoo" must break loop');
|
throw new Test262Error('#1.1: "break woohoo" must break loop');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (i!==10) $ERROR('#1.2: i===10. Actual: i==='+ i );
|
throw new Test262Error('This code should be unreacheable');
|
||||||
}
|
}
|
||||||
|
assert.sameValue(i, 10);
|
||||||
|
|
Loading…
Reference in New Issue