Removed most of mirrors.js and debug.js. Further steps: - migrate liveedit.js to native, - remove debugger context. R=yangguo@chromium.org TBR=leszeks@chromium.org Bug: v8:5530 Cq-Include-Trybots: luci.chromium.try:linux_chromium_headless_rel;master.tryserver.blink:linux_trusty_blink_rel Change-Id: I291ef20ef3c63a424d32e3e0c9d0962a6ca382d1 Reviewed-on: https://chromium-review.googlesource.com/1081176 Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> Reviewed-by: Yang Guo <yangguo@chromium.org> Reviewed-by: Dmitry Gozman <dgozman@chromium.org> Cr-Commit-Position: refs/heads/master@{#53480}
41 lines
1.0 KiB
JavaScript
41 lines
1.0 KiB
JavaScript
// Copyright 2018 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.
|
|
|
|
Debug = debug.Debug
|
|
|
|
function foo(){}
|
|
|
|
let breakpoint_count = 0;
|
|
let last_source_line = 0;
|
|
let last_source_column = 0;
|
|
function listener(event, exec_state, event_data, data) {
|
|
if (event == Debug.DebugEvent.Break) {
|
|
++breakpoint_count;
|
|
last_source_line = exec_state.frame(0).sourceLine();
|
|
last_source_column = exec_state.frame(0).sourceColumn();
|
|
}
|
|
};
|
|
|
|
Debug.setListener(listener);
|
|
|
|
// Run without breakpoints.
|
|
foo();
|
|
assertEquals(breakpoint_count, 0);
|
|
|
|
// Run with breakpoint.
|
|
const breakpoint = Debug.setBreakPoint(foo, 0);
|
|
foo();
|
|
assertEquals(breakpoint_count, 1);
|
|
assertEquals(last_source_line, 7);
|
|
assertEquals(last_source_column, 15);
|
|
foo();
|
|
assertEquals(breakpoint_count, 2);
|
|
assertEquals(last_source_line, 7);
|
|
assertEquals(last_source_column, 15);
|
|
|
|
// Run without breakpoints
|
|
Debug.clearBreakPoint(breakpoint);
|
|
foo();
|
|
assertEquals(breakpoint_count, 2);
|