Fix assertions previously not reached before

Fix #2049
This commit is contained in:
Leo Balter 2019-03-06 12:39:58 -05:00 committed by Rick Waldron
parent 8e2a07d2e1
commit e227f54d01
2 changed files with 11 additions and 10 deletions

View File

@ -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);

View File

@ -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);