| OLD | NEW |
| 1 description( | 1 description( |
| 2 'Tests to make sure that dynamic scope objects are correctly protected from GC.
To pass we need to not crash.' | 2 'Tests to make sure that dynamic scope objects are correctly protected from GC.
To pass we need to not crash.' |
| 3 ); | 3 ); |
| 4 | 4 |
| 5 function gc() | 5 function gc() |
| 6 { | 6 { |
| 7 if (this.GCController) | 7 if (this.GCController) |
| 8 GCController.collect(); | 8 GCController.collectAll(); |
| 9 else | 9 else |
| 10 for (var i = 0; i < 10000; ++i) // Allocate a sufficient number of objec
ts to force a GC. | 10 for (var i = 0; i < 10000; ++i) // Allocate a sufficient number of objec
ts to force a GC. |
| 11 ({}); | 11 ({}); |
| 12 } | 12 } |
| 13 | 13 |
| 14 (function() { | 14 (function() { |
| 15 try { | 15 try { |
| 16 // Immediate value for scope | 16 // Immediate value for scope |
| 17 with(1) { gc(); a; } | 17 with(1) { gc(); a; } |
| 18 } catch(e) { | 18 } catch(e) { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 38 // Test catch blocks for the heck of it | 38 // Test catch blocks for the heck of it |
| 39 try { | 39 try { |
| 40 throw 1; | 40 throw 1; |
| 41 } catch(e) { | 41 } catch(e) { |
| 42 gc(); | 42 gc(); |
| 43 b; | 43 b; |
| 44 } | 44 } |
| 45 } catch (e) { | 45 } catch (e) { |
| 46 } | 46 } |
| 47 })(); | 47 })(); |
| OLD | NEW |