| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 assertEquals(debugger_source_position + 38, | 94 assertEquals(debugger_source_position + 38, |
| 95 exec_state.frame(0).sourcePosition()); | 95 exec_state.frame(0).sourcePosition()); |
| 96 } | 96 } |
| 97 break; | 97 break; |
| 98 default: | 98 default: |
| 99 fail("Unexpected"); | 99 fail("Unexpected"); |
| 100 } | 100 } |
| 101 exec_state.prepareStep(Debug.StepAction.StepIn, 1); | 101 exec_state.prepareStep(Debug.StepAction.StepIn, 1); |
| 102 } else { | 102 } else { |
| 103 // Position at the end of the function. | 103 // Position at the end of the function. |
| 104 assertEquals(debugger_source_position + 51, | 104 assertEquals(debugger_source_position + 50, |
| 105 exec_state.frame(0).sourcePosition()); | 105 exec_state.frame(0).sourcePosition()); |
| 106 | 106 |
| 107 // Just about to return from the function. | 107 // Just about to return from the function. |
| 108 assertTrue(exec_state.frame(0).isAtReturn()) | 108 assertTrue(exec_state.frame(0).isAtReturn()) |
| 109 assertEquals(expected_return_value, | 109 assertEquals(expected_return_value, |
| 110 exec_state.frame(0).returnValue().value()); | 110 exec_state.frame(0).returnValue().value()); |
| 111 | 111 |
| 112 // Check the same using the JSON commands. | 112 // Check the same using the JSON commands. |
| 113 var dcp = exec_state.debugCommandProcessor(false); | 113 var dcp = exec_state.debugCommandProcessor(false); |
| 114 var request = '{"seq":0,"type":"request","command":"backtrace"}'; | 114 var request = '{"seq":0,"type":"request","command":"backtrace"}'; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 assertTrue(listener_complete); | 154 assertTrue(listener_complete); |
| 155 assertEquals(4, break_count); | 155 assertEquals(4, break_count); |
| 156 | 156 |
| 157 break_count = 0; | 157 break_count = 0; |
| 158 expected_return_value = 2; | 158 expected_return_value = 2; |
| 159 listener_complete = false; | 159 listener_complete = false; |
| 160 f(false); | 160 f(false); |
| 161 assertFalse(exception, "exception in listener") | 161 assertFalse(exception, "exception in listener") |
| 162 assertTrue(listener_complete); | 162 assertTrue(listener_complete); |
| 163 assertEquals(4, break_count); | 163 assertEquals(4, break_count); |
| OLD | NEW |