| 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 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 var exception = null; | 32 var exception = null; |
| 33 var state = 0; | 33 var state = 0; |
| 34 | 34 |
| 35 // Simple debug event handler which first time will cause 'step in' action | 35 // Simple debug event handler which first time will cause 'step in' action |
| 36 // to get into g.call and than check that execution is pauesed inside | 36 // to get into g.call and than check that execution is pauesed inside |
| 37 // function 'g'. | 37 // function 'g'. |
| 38 function listener(event, exec_state, event_data, data) { | 38 function listener(event, exec_state, event_data, data) { |
| 39 try { | 39 try { |
| 40 if (event == Debug.DebugEvent.Break) { | 40 if (event == Debug.DebugEvent.Break) { |
| 41 if (state == 0) { | 41 if (state < 2) { |
| 42 // Step into f2.call: | 42 // Step into f2.call: |
| 43 exec_state.prepareStep(Debug.StepAction.StepIn, 2); | 43 exec_state.prepareStep(Debug.StepAction.StepIn); |
| 44 state = 2; | 44 state++; |
| 45 } else if (state == 2) { | 45 } else { |
| 46 assertEquals('g', event_data.func().name()); | 46 assertEquals('g', event_data.func().name()); |
| 47 assertEquals(' return t + 1; // expected line', | 47 assertEquals(' return t + 1; // expected line', |
| 48 event_data.sourceLineText()); | 48 event_data.sourceLineText()); |
| 49 state = 3; | 49 state = 3; |
| 50 } | 50 } |
| 51 } | 51 } |
| 52 } catch(e) { | 52 } catch(e) { |
| 53 exception = e; | 53 exception = e; |
| 54 } | 54 } |
| 55 }; | 55 }; |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 // Test global bound function. | 166 // Test global bound function. |
| 167 state = 0; | 167 state = 0; |
| 168 var globalBound = g.bind(null, 3); | 168 var globalBound = g.bind(null, 3); |
| 169 debugger; | 169 debugger; |
| 170 globalBound(); | 170 globalBound(); |
| 171 assertNull(exception); | 171 assertNull(exception); |
| 172 assertEquals(3, state); | 172 assertEquals(3, state); |
| 173 | 173 |
| 174 // Get rid of the debug event listener. | 174 // Get rid of the debug event listener. |
| 175 Debug.setListener(null); | 175 Debug.setListener(null); |
| OLD | NEW |