OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 var error = "error"; | 5 var error = "error"; |
6 function counter(x) { | 6 function counter(x) { |
7 return (function() { if (x-- == 0) throw error;}); | 7 return (function() { if (x-- == 0) throw error;}); |
8 } | 8 } |
9 | 9 |
10 function Module() { | 10 function Module() { |
(...skipping 17 matching lines...) Expand all Loading... |
28 | 28 |
29 function w3(f) { | 29 function w3(f) { |
30 if (0) while (1) f(); | 30 if (0) while (1) f(); |
31 return 111; | 31 return 111; |
32 } | 32 } |
33 | 33 |
34 return { w0: w0, w1: w1, w2: w2, w3: w3 }; | 34 return { w0: w0, w1: w1, w2: w2, w3: w3 }; |
35 } | 35 } |
36 | 36 |
37 var m = Module(); | 37 var m = Module(); |
38 assertThrows(function() { m.w0(counter(5)) }, error); | 38 assertThrowsEquals(function() { m.w0(counter(5)) }, error); |
39 assertThrows(function() { m.w1(counter(5)) }, error); | 39 assertThrowsEquals(function() { m.w1(counter(5)) }, error); |
40 assertThrows(function() { m.w2(counter(5)) }, error); | 40 assertThrowsEquals(function() { m.w2(counter(5)) }, error); |
41 assertEquals(111, m.w3(counter(5))); | 41 assertEquals(111, m.w3(counter(5))); |
OLD | NEW |