| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 23 matching lines...) Expand all Loading... |
| 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 stopped 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 == 3) { |
| 45 exec_state.prepareStep(Debug.StepAction.StepIn, 2); | |
| 46 state = 2; | |
| 47 } else if (state == 2) { | |
| 48 assertEquals(expected_source_line_text, | 45 assertEquals(expected_source_line_text, |
| 49 event_data.sourceLineText()); | 46 event_data.sourceLineText()); |
| 50 assertEquals(expected_function_name, event_data.func().name()); | 47 assertEquals(expected_function_name, event_data.func().name()); |
| 51 state = 3; | 48 state = 4; |
| 49 } else { |
| 50 exec_state.prepareStep(Debug.StepAction.StepIn); |
| 51 state++; |
| 52 } | 52 } |
| 53 } | 53 } |
| 54 } catch(e) { | 54 } catch(e) { |
| 55 exception = e; | 55 exception = e; |
| 56 } | 56 } |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 // Add the debug event listener. | 59 // Add the debug event listener. |
| 60 Debug.setListener(listener); | 60 Debug.setListener(listener); |
| 61 | 61 |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 e['setter' + i] = 'aa'; | 234 e['setter' + i] = 'aa'; |
| 235 } | 235 } |
| 236 | 236 |
| 237 for (var n in this) { | 237 for (var n in this) { |
| 238 if (n.substr(0, 4) != 'test') { | 238 if (n.substr(0, 4) != 'test') { |
| 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(4, 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 |