OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 21 matching lines...) Expand all Loading... |
32 // Note: the following tests only checks the debugger handling of the | 32 // Note: the following tests only checks the debugger handling of the |
33 // setexceptionbreak command. It does not test whether the debugger | 33 // setexceptionbreak command. It does not test whether the debugger |
34 // actually breaks on exceptions or not. That functionality is tested | 34 // actually breaks on exceptions or not. That functionality is tested |
35 // in test-debug.cc instead. | 35 // in test-debug.cc instead. |
36 | 36 |
37 // Note: The following function g() is purposedly placed here so that | 37 // Note: The following function g() is purposedly placed here so that |
38 // its line numbers will not change should we add more lines of test code | 38 // its line numbers will not change should we add more lines of test code |
39 // below. The test checks for these line numbers. | 39 // below. The test checks for these line numbers. |
40 | 40 |
41 function g() { // line 40 | 41 function g() { // line 40 |
42 var x = 5; | 42 var x = 5; |
43 var y = 6; | 43 var y = 6; |
44 var z = 7; | 44 var z = 7; |
45 }; | 45 }; |
46 | 46 |
47 var first_lineno = 40; // Must be the line number of g() above. | 47 var first_lineno = 40; // Must be the line number of g() above. |
48 // The first line of the file is line 0. | 48 // The first line of the file is line 0. |
49 | 49 |
50 // Simple function which stores the last debug event. | 50 // Simple function which stores the last debug event. |
51 listenerComplete = false; | 51 listenerComplete = false; |
52 exception = false; | 52 exception = false; |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 // Add the debug event listener. | 201 // Add the debug event listener. |
202 Debug.setListener(listener); | 202 Debug.setListener(listener); |
203 | 203 |
204 // Set a break point and call to invoke the debug event listener. | 204 // Set a break point and call to invoke the debug event listener. |
205 breakpoint1 = Debug.setBreakPoint(g, 0, 0); | 205 breakpoint1 = Debug.setBreakPoint(g, 0, 0); |
206 g(); | 206 g(); |
207 | 207 |
208 // Make sure that the debug event listener vas invoked. | 208 // Make sure that the debug event listener vas invoked. |
209 assertFalse(exception, "exception in listener") | 209 assertFalse(exception, "exception in listener") |
210 assertTrue(listenerComplete, "listener did not run to completion"); | 210 assertTrue(listenerComplete, "listener did not run to completion"); |
OLD | NEW |