Skip to content

Commit dcccc68

Browse files
targosMylesBorins
authored andcommitted
deps: cherry-pick baba152 from V8 upstream
Original commit message: fix stepping out of across throwing. [email protected] BUG=v8:5559 Review-Url: https://codereview.chromium.org/2445233004 Cr-Commit-Position: refs/heads/master@{#40549} PR-URL: #10689 Fixes: #9175 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ali Ijaz Sheikh <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
1 parent 182e042 commit dcccc68

File tree

3 files changed

+40
-2
lines changed

3 files changed

+40
-2
lines changed

deps/v8/include/v8-version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define V8_MAJOR_VERSION 5
1212
#define V8_MINOR_VERSION 1
1313
#define V8_BUILD_NUMBER 281
14-
#define V8_PATCH_LEVEL 90
14+
#define V8_PATCH_LEVEL 91
1515

1616
// Use 1 for candidates and 0 otherwise.
1717
// (Boolean macro values are not supported by all preprocessors.)

deps/v8/src/debug/debug.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,7 @@ void Debug::PrepareStepOnThrow() {
962962
it.Advance();
963963
}
964964

965-
if (last_step_action() == StepNext) {
965+
if (last_step_action() == StepNext || last_step_action() == StepOut) {
966966
while (!it.done()) {
967967
Address current_fp = it.frame()->UnpaddedFP();
968968
if (current_fp >= thread_local_.target_fp_) break;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// Copyright 2016 the V8 project authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
// Flags: --expose-debug-as debug
6+
7+
Debug = debug.Debug
8+
9+
var exception = null;
10+
var break_count = 0;
11+
12+
function listener(event, exec_state, event_data, data) {
13+
if (event != Debug.DebugEvent.Break) return;
14+
try {
15+
print(event_data.sourceLineText());
16+
assertTrue(
17+
event_data.sourceLineText().indexOf(`Break ${break_count++}.`) > 0);
18+
exec_state.prepareStep(Debug.StepAction.StepOut);
19+
} catch (e) {
20+
exception = e;
21+
}
22+
};
23+
24+
function thrower() {
25+
try {
26+
debugger; // Break 0.
27+
throw 'error';
28+
} catch (err) {
29+
}
30+
}
31+
32+
33+
Debug.setListener(listener);
34+
thrower();
35+
Debug.setListener(null); // Break 1.
36+
37+
assertNull(exception);
38+
assertEquals(2, break_count);

0 commit comments

Comments
 (0)