Browse Source

Merge branch 'improve-invalid-opcode-test'

pull/92/head
Sami Vaarala 10 years ago
parent
commit
5e7a7241fd
  1. 59
      ecmascript-testcases/test-bug-labelled-stmts.js

59
ecmascript-testcases/test-bug-labelled-stmts.js

@ -0,0 +1,59 @@
/*
* Bug testcases for a few labelled statement cases.
*/
/*===
if 1
if 3
block 1
block 3
with 1
with 3
===*/
function testIf() {
test:
if (1) {
print('if 1');
break test;
print('if 2');
}
print('if 3');
}
function testBlock() {
test:
{
print('block 1');
break test;
print('block 2');
}
print('block 3');
}
function testWith() {
test:
with ({}) {
print('with 1');
break test;
print('with 2');
}
print('with 3');
}
try {
testIf();
} catch (e) {
print(e.stack || e);
}
try {
testBlock();
} catch (e) {
print(e.stack || e);
}
try {
testWith();
} catch (e) {
print(e.stack || e);
}
Loading…
Cancel
Save