tizen beta release
[profile/ivi/webkit-efl.git] / LayoutTests / fast / js / script-tests / for-in-exeception.js
1 description('Test for (foo in somethingWhichThrows) to catch ASSERT');
2
3 function throwNullException() {
4   throw null;
5 }
6
7 function throwUndefinedException() {
8   throw undefined;
9 }
10
11 function throwStringException() {
12   throw "PASSED"
13 }
14
15 function test(func) {
16   for (var foo in func()) {
17     testFailed("Shoud not be reached");
18   }
19 }
20
21 shouldBeUndefined("test(throwUndefinedException)");
22 shouldBeUndefined("test(throwNullException)");
23 shouldThrow("test(throwStringException)");