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. 9 function f() { 10 var i0 = 0; var i1 = 1; var i2 = 2; var i3 = 3; 14 var j0 = 0; 15 var j1 = 1; 16 var j2 = 2; 17 var j3 = 3; 18 } 19 20 Debug = debug.Debug; 21 var exception = null; 22 var break_point_hit = false; 23 24 function 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 35 Debug.setListener(listener); 36 37 Debug.setBreakPoint(f, 3, 0); 38 39 f(); 40 41 Debug.setListener(null); 42 assertTrue(break_point_hit); 43 assertNull(exception); 44