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