blob: 7e99f87ae9b57247fa2a1362a7f08949edb96021 [file] [log] [blame]
eric@webkit.orgb3975172007-12-27 22:20:18 +00001description('Test for (foo in somethingWhichThrows) to catch ASSERT');
2
3function throwNullException() {
4 throw null;
5}
6
7function throwUndefinedException() {
8 throw undefined;
9}
10
11function throwStringException() {
12 throw "PASSED"
13}
14
15function test(func) {
16 for (var foo in func()) {
17 testFailed("Shoud not be reached");
18 }
19}
20
21shouldBeUndefined("test(throwUndefinedException)");
22shouldBeUndefined("test(throwNullException)");
23shouldThrow("test(throwStringException)");