• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2015 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// Do not edit this file with an editor that replaces \r with \r\n.
8// Variable definitions for i0 through i3 are each terminated with \r.
9function f() {
10  var i0 = 0;
11  var i1 = 1;
12  var i2 = 2;
13  var i3 = 3;
14  var j0 = 0;
15  var j1 = 1;
16  var j2 = 2;
17  var j3 = 3;
18}
19
20Debug = debug.Debug;
21var exception = null;
22var break_point_hit = false;
23
24function listener(event, exec_state, event_data, data) {
25  if (event != Debug.DebugEvent.Break) return;
26  try {
27    break_point_hit = true;
28    assertEquals("  var i2 = 2;", exec_state.frame(0).sourceLineText());
29  } catch (e) {
30    print(e + e.stack);
31    exception = e;
32  }
33}
34
35Debug.setListener(listener);
36
37Debug.setBreakPoint(f, 3, 0);
38
39f();
40
41Debug.setListener(null);
42assertTrue(break_point_hit);
43assertNull(exception);
44