| 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 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 // Get the Debug object exposed from the debug context global object. | 30 // Get the Debug object exposed from the debug context global object. |
| 31 Debug = debug.Debug | 31 Debug = debug.Debug |
| 32 | 32 |
| 33 var exception = null; | 33 var exception = null; |
| 34 var state = 1; | 34 var state = 1; |
| 35 var expected_source_line_text = null; | 35 var expected_source_line_text = null; |
| 36 var expected_function_name = null; | 36 var expected_function_name = null; |
| 37 | 37 |
| 38 // Simple debug event handler which first time will cause 'step in' action | 38 // Simple debug event handler which first time will cause 'step in' action |
| 39 // to get into g.call and than check that execution is pauesed inside | 39 // to get into g.call and than check that execution is stopped inside |
| 40 // function 'g'. | 40 // function 'g'. |
| 41 function listener(event, exec_state, event_data, data) { | 41 function listener(event, exec_state, event_data, data) { |
| 42 try { | 42 try { |
| 43 if (event == Debug.DebugEvent.Break) { | 43 if (event == Debug.DebugEvent.Break) { |
| 44 if (state == 1) { | 44 if (state == 1) { |
| 45 exec_state.prepareStep(Debug.StepAction.StepIn, 2); | 45 exec_state.prepareStep(Debug.StepAction.StepIn, 2); |
| 46 state = 2; | 46 state = 2; |
| 47 } else if (state == 2) { | 47 } else if (state == 2) { |
| 48 assertEquals(expected_source_line_text, | 48 assertEquals(expected_source_line_text, |
| 49 event_data.sourceLineText()); | 49 event_data.sourceLineText()); |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 continue; | 239 continue; |
| 240 } | 240 } |
| 241 state = 1; | 241 state = 1; |
| 242 this[n](); | 242 this[n](); |
| 243 assertNull(exception); | 243 assertNull(exception); |
| 244 assertEquals(3, state); | 244 assertEquals(3, state); |
| 245 } | 245 } |
| 246 | 246 |
| 247 // Get rid of the debug event listener. | 247 // Get rid of the debug event listener. |
| 248 Debug.setListener(null); | 248 Debug.setListener(null); |
| OLD | NEW |