2017-02-02 07:31:09 +00:00
|
|
|
// Copyright 2017 the V8 project authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2017-07-13 12:27:47 +00:00
|
|
|
// Flags: --no-stress-fullcodegen
|
2017-02-02 07:31:09 +00:00
|
|
|
|
|
|
|
function f() {
|
|
|
|
throw new Error();
|
|
|
|
}
|
|
|
|
|
|
|
|
function g() {
|
|
|
|
try {
|
|
|
|
f();
|
|
|
|
} catch (e) {
|
|
|
|
return 1; // Break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function h() {
|
|
|
|
return g();
|
|
|
|
}
|
|
|
|
|
|
|
|
h();
|
|
|
|
h();
|
|
|
|
|
|
|
|
var Debug = debug.Debug;
|
|
|
|
var step_count = 0;
|
|
|
|
var exception = null;
|
|
|
|
|
|
|
|
function listener(event, exec_state, event_data, data) {
|
|
|
|
if (event == Debug.DebugEvent.Exception) {
|
|
|
|
step_count++;
|
|
|
|
exec_state.prepareStep(Debug.StepAction.StepNext);
|
|
|
|
} else if (event == Debug.DebugEvent.Break) {
|
|
|
|
step_count++;
|
|
|
|
try {
|
|
|
|
assertTrue(exec_state.frame().sourceLineText().includes('Break'));
|
|
|
|
} catch (e) {
|
|
|
|
exception = e;
|
|
|
|
print(e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Debug.setListener(listener);
|
|
|
|
Debug.setBreakOnException();
|
2017-06-02 17:20:20 +00:00
|
|
|
%OptimizeFunctionOnNextCall(h);
|
2017-02-02 07:31:09 +00:00
|
|
|
h();
|
|
|
|
Debug.setListener(null);
|
|
|
|
assertNull(exception);
|