debug-step-end-of-script.js 566 Bytes
Newer Older
1 2 3 4 5 6
// Copyright 2015 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.


var Debug = debug.Debug;
7
var expected = ["debugger;", ""];
8 9 10 11 12

function listener(event, exec_state, event_data, data) {
  if (event != Debug.DebugEvent.Break) return;
  try {
    assertEquals(expected.shift(), exec_state.frame(0).sourceLineText());
13
    exec_state.prepareStep(Debug.StepAction.StepNext);
14 15 16 17 18 19 20
  } catch (e) {
    %AbortJS(e + "\n" + e.stack);
  }
}

Debug.setListener(listener);
debugger;