tizen beta release
[profile/ivi/webkit-efl.git] / LayoutTests / fast / js / script-tests / exception-try-finally-scope-error.js
1 description('This test makes sure stack unwinding works correctly in combination with dynamically added scopes');
2
3 function gc()
4 {
5     if (this.GCController)
6         GCController.collect();
7     else
8         for (var i = 0; i < 10000; ++i) // Allocate a sufficient number of objects to force a GC.
9             ({});
10 }
11
12 var result;
13 function runTest() {
14     var test = "outer scope";
15     with({test:"inner scope"})
16        (function () { try { throw ""; } finally { result = test; shouldBe("result", '"inner scope"'); return;}})()
17 }
18 runTest();
19
20 try{
21 (function() {
22     try {
23         throw "";
24     } catch(y) {
25         throw (function(){});
26     } finally {
27     }
28 })()
29 }catch(r){
30 }
31
32 // Just clobber any temporaries
33 a=({});
34 a*=a*a*a;
35
36 gc();