2013-04-27 03:07:56 +08:00
|
|
|
var repl = require('./helper-debugger-repl.js');
|
2011-09-23 01:03:46 +08:00
|
|
|
|
2013-04-27 03:07:56 +08:00
|
|
|
repl.startDebugger('breakpoints.js');
|
2012-03-21 10:48:07 +08:00
|
|
|
|
2013-04-27 03:07:56 +08:00
|
|
|
var addTest = repl.addTest;
|
2011-09-23 01:03:46 +08:00
|
|
|
|
|
|
|
// Next
|
|
|
|
addTest('n', [
|
2011-11-05 00:20:53 +08:00
|
|
|
/break in .*:11/,
|
|
|
|
/9/, /10/, /11/, /12/, /13/
|
2011-09-23 01:03:46 +08:00
|
|
|
]);
|
|
|
|
|
2011-09-30 02:18:35 +08:00
|
|
|
// Watch
|
2013-02-27 08:42:47 +08:00
|
|
|
addTest('watch("\'x\'")');
|
2011-09-30 02:18:35 +08:00
|
|
|
|
2011-09-23 01:03:46 +08:00
|
|
|
// Continue
|
|
|
|
addTest('c', [
|
2011-11-05 00:20:53 +08:00
|
|
|
/break in .*:5/,
|
2011-09-30 02:18:35 +08:00
|
|
|
/Watchers/,
|
|
|
|
/0:\s+'x' = "x"/,
|
|
|
|
/()/,
|
2011-11-05 00:20:53 +08:00
|
|
|
/3/, /4/, /5/, /6/, /7/
|
2011-09-23 01:03:46 +08:00
|
|
|
]);
|
|
|
|
|
2011-09-30 02:18:35 +08:00
|
|
|
// Show watchers
|
|
|
|
addTest('watchers', [
|
|
|
|
/0:\s+'x' = "x"/
|
|
|
|
]);
|
|
|
|
|
|
|
|
// Unwatch
|
2013-02-27 08:42:47 +08:00
|
|
|
addTest('unwatch("\'x\'")');
|
2011-09-30 02:18:35 +08:00
|
|
|
|
2011-09-23 01:03:46 +08:00
|
|
|
// Step out
|
|
|
|
addTest('o', [
|
2011-11-05 00:20:53 +08:00
|
|
|
/break in .*:12/,
|
|
|
|
/10/, /11/, /12/, /13/, /14/
|
2011-09-23 01:03:46 +08:00
|
|
|
]);
|
|
|
|
|
2011-09-26 03:20:47 +08:00
|
|
|
// Continue
|
|
|
|
addTest('c', [
|
2011-11-05 00:20:53 +08:00
|
|
|
/break in .*:5/,
|
|
|
|
/3/, /4/, /5/, /6/, /7/
|
2011-09-26 03:20:47 +08:00
|
|
|
]);
|
|
|
|
|
2011-09-27 14:25:31 +08:00
|
|
|
// Set breakpoint by function name
|
|
|
|
addTest('sb("setInterval()", "!(setInterval.flag++)")', [
|
2011-11-05 00:20:53 +08:00
|
|
|
/1/, /2/, /3/, /4/, /5/, /6/, /7/, /8/, /9/, /10/
|
2011-09-27 14:25:31 +08:00
|
|
|
]);
|
|
|
|
|
|
|
|
// Continue
|
|
|
|
addTest('c', [
|
2011-09-29 02:17:12 +08:00
|
|
|
/break in node.js:\d+/,
|
|
|
|
/\d/, /\d/, /\d/, /\d/, /\d/
|
2011-09-27 14:25:31 +08:00
|
|
|
]);
|
|
|
|
|
2014-04-27 16:42:43 +08:00
|
|
|
// REPL and process.env regression
|
|
|
|
addTest('repl', [
|
|
|
|
/Ctrl/
|
|
|
|
]);
|
|
|
|
|
|
|
|
addTest('for (var i in process.env) delete process.env[i]', []);
|
|
|
|
|
|
|
|
addTest('process.env', [
|
|
|
|
/\{\}/
|
|
|
|
]);
|