7ef542dc4a
TBR=machenbach@chromium.org Bug: v8:6457 Change-Id: I75cf773941fc4f3eb6878df14f757ba1d2e23926 Reviewed-on: https://chromium-review.googlesource.com/522647 Reviewed-by: Igor Sheludko <ishell@chromium.org> Commit-Queue: Igor Sheludko <ishell@chromium.org> Cr-Commit-Position: refs/heads/master@{#45697}
46 lines
867 B
JavaScript
46 lines
867 B
JavaScript
// 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.
|
|
|
|
function f() {
|
|
debugger;
|
|
return 1;
|
|
}
|
|
|
|
function g() {
|
|
return f();
|
|
} // 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.Break) return;
|
|
try {
|
|
if (step_count == 0) {
|
|
exec_state.prepareStep(Debug.StepAction.StepOut);
|
|
} else {
|
|
assertTrue(exec_state.frame().sourceLineText().includes('Break'));
|
|
}
|
|
step_count++;
|
|
} catch (e) {
|
|
exception = e;
|
|
print(e);
|
|
}
|
|
}
|
|
|
|
Debug.setListener(listener);
|
|
%OptimizeFunctionOnNextCall(h);
|
|
h();
|
|
Debug.setListener(null);
|
|
assertNull(exception);
|
|
assertEquals(2, step_count);
|