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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 // Add the debug event listener. | 129 // Add the debug event listener. |
130 Debug.setListener(listener); | 130 Debug.setListener(listener); |
131 | 131 |
132 function f() { | 132 function f() { |
133 var a = 3; | 133 var a = 3; |
134 }; | 134 }; |
135 | 135 |
136 function g() { | 136 function g() { |
137 var a = 2; | 137 var a = 2; |
138 f(); | 138 f(); |
| 139 return a; // Use the value to prevent it being removed by DCE. |
139 }; | 140 }; |
140 | 141 |
141 a = 1; | 142 a = 1; |
142 | 143 |
143 // String which is longer than 80 chars. | 144 // String which is longer than 80 chars. |
144 var longString = "1234567890_"; | 145 var longString = "1234567890_"; |
145 for (var i = 0; i < 4; i++) { | 146 for (var i = 0; i < 4; i++) { |
146 longString += longString; | 147 longString += longString; |
147 } | 148 } |
148 | 149 |
149 // Set a break point at return in f and invoke g to hit the breakpoint. | 150 // Set a break point at return in f and invoke g to hit the breakpoint. |
150 Debug.setBreakPoint(f, 2, 0); | 151 Debug.setBreakPoint(f, 2, 0); |
151 g(); | 152 g(); |
152 | 153 |
153 assertFalse(exception, "exception in listener") | 154 assertFalse(exception, "exception in listener") |
154 // Make sure that the debug event listener vas invoked. | 155 // Make sure that the debug event listener vas invoked. |
155 assertTrue(listenerComplete, "listener did not run to completion"); | 156 assertTrue(listenerComplete, "listener did not run to completion"); |
OLD | NEW |