OLD | NEW |
1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 | 88 |
89 // Indicate that all was processed. | 89 // Indicate that all was processed. |
90 listenerComplete = true; | 90 listenerComplete = true; |
91 } | 91 } |
92 } catch (e) { | 92 } catch (e) { |
93 exception = e | 93 exception = e |
94 }; | 94 }; |
95 }; | 95 }; |
96 | 96 |
97 // Add the debug event listener. | 97 // Add the debug event listener. |
98 Debug.addListener(listener); | 98 Debug.setListener(listener); |
99 | 99 |
100 function f() { | 100 function f() { |
101 var a = 3; | 101 var a = 3; |
102 }; | 102 }; |
103 | 103 |
104 function g() { | 104 function g() { |
105 var a = 2; | 105 var a = 2; |
106 f(); | 106 f(); |
107 }; | 107 }; |
108 | 108 |
109 a = 1; | 109 a = 1; |
110 | 110 |
111 // Set a break point at return in f and invoke g to hit the breakpoint. | 111 // Set a break point at return in f and invoke g to hit the breakpoint. |
112 Debug.setBreakPoint(f, 2, 0); | 112 Debug.setBreakPoint(f, 2, 0); |
113 g(); | 113 g(); |
114 | 114 |
115 // Make sure that the debug event listener vas invoked. | 115 // Make sure that the debug event listener vas invoked. |
116 assertTrue(listenerComplete, "listener did not run to completion"); | 116 assertTrue(listenerComplete, "listener did not run to completion"); |
117 assertFalse(exception, "exception in listener") | 117 assertFalse(exception, "exception in listener") |
OLD | NEW |