| 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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 | 103 |
| 104 | 104 |
| 105 // Event listener which evaluates with break enabled one time and the second | 105 // Event listener which evaluates with break enabled one time and the second |
| 106 // time evaluates with break disabled. | 106 // time evaluates with break disabled. |
| 107 var break_count = 0; | 107 var break_count = 0; |
| 108 function listener_recurse(event, exec_state, event_data, data) { | 108 function listener_recurse(event, exec_state, event_data, data) { |
| 109 try { | 109 try { |
| 110 if (event == Debug.DebugEvent.Break) | 110 if (event == Debug.DebugEvent.Break) |
| 111 { | 111 { |
| 112 break_count++; | 112 break_count++; |
| 113 | 113 |
| 114 // Call functions with break using the FrameMirror directly. | 114 // Call functions with break using the FrameMirror directly. |
| 115 if (break_count == 1) { | 115 if (break_count == 1) { |
| 116 // First break event evaluates with break enabled. | 116 // First break event evaluates with break enabled. |
| 117 assertEquals(1, exec_state.frame(0).evaluate('f()', false).value()); | 117 assertEquals(1, exec_state.frame(0).evaluate('f()', false).value()); |
| 118 listenerComplete = true; | 118 listenerComplete = true; |
| 119 } else { | 119 } else { |
| 120 // Second break event evaluates with break disabled. | 120 // Second break event evaluates with break disabled. |
| 121 assertEquals(2, break_count); | 121 assertEquals(2, break_count); |
| 122 assertFalse(listenerComplete); | 122 assertFalse(listenerComplete); |
| 123 assertEquals(1, exec_state.frame(0).evaluate('f()', true).value()); | 123 assertEquals(1, exec_state.frame(0).evaluate('f()', true).value()); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 listenerComplete = false; | 158 listenerComplete = false; |
| 159 | 159 |
| 160 Debug.setBreakPoint(f, 2, 0); | 160 Debug.setBreakPoint(f, 2, 0); |
| 161 | 161 |
| 162 debugger; | 162 debugger; |
| 163 | 163 |
| 164 assertFalse(exception, "exception in listener") | 164 assertFalse(exception, "exception in listener") |
| 165 // Make sure that the debug event listener vas invoked. | 165 // Make sure that the debug event listener vas invoked. |
| 166 assertTrue(listenerComplete); | 166 assertTrue(listenerComplete); |
| 167 assertEquals(2, break_count); | 167 assertEquals(2, break_count); |
| OLD | NEW |