Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(237)

Side by Side Diff: test/mjsunit/regress/regress-1586.js

Issue 1181013007: Debugger: require debugger to be active when dealing with breaks. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix yet another test Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/mjsunit/es6/generators-relocation.js ('k') | test/mjsunit/regress/regress-2318.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 25 matching lines...) Expand all
36 try { // Line 3. 36 try { // Line 3.
37 throw 'stuff'; // Line 4. 37 throw 'stuff'; // Line 4.
38 } catch (e) { // Line 5. 38 } catch (e) { // Line 5.
39 x = 2; // Line 6. 39 x = 2; // Line 6.
40 } 40 }
41 } 41 }
42 }; 42 };
43 43
44 // Get the Debug object exposed from the debug context global object. 44 // Get the Debug object exposed from the debug context global object.
45 Debug = debug.Debug 45 Debug = debug.Debug
46 // Set breakpoint on line 6.
47 var bp = Debug.setBreakPoint(f, 6);
48 46
49 function listener(event, exec_state, event_data, data) { 47 function listener(event, exec_state, event_data, data) {
50 if (event == Debug.DebugEvent.Break) { 48 if (event == Debug.DebugEvent.Break) {
51 result = exec_state.frame().evaluate("i").value(); 49 result = exec_state.frame().evaluate("i").value();
52 } 50 }
53 }; 51 };
54 52
55 // Add the debug event listener. 53 // Add the debug event listener.
56 Debug.setListener(listener); 54 Debug.setListener(listener);
55
56 //Set breakpoint on line 6.
57 var bp = Debug.setBreakPoint(f, 6);
58
57 result = -1; 59 result = -1;
58 f(); 60 f();
59 assertEquals(1, result); 61 assertEquals(1, result);
60 62
61 // Clear breakpoint. 63 // Clear breakpoint.
62 Debug.clearBreakPoint(bp); 64 Debug.clearBreakPoint(bp);
63 // Get rid of the debug event listener. 65 // Get rid of the debug event listener.
64 Debug.setListener(null); 66 Debug.setListener(null);
OLDNEW
« no previous file with comments | « test/mjsunit/es6/generators-relocation.js ('k') | test/mjsunit/regress/regress-2318.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698