2011-09-23 01:03:46 +08:00
|
|
|
// Copyright Joyent, Inc. and other Node contributors.
|
|
|
|
//
|
|
|
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
// copy of this software and associated documentation files (the
|
|
|
|
// "Software"), to deal in the Software without restriction, including
|
|
|
|
// without limitation the rights to use, copy, modify, merge, publish,
|
|
|
|
// distribute, sublicense, and/or sell copies of the Software, and to permit
|
|
|
|
// persons to whom the Software is furnished to do so, subject to the
|
|
|
|
// following conditions:
|
|
|
|
//
|
|
|
|
// The above copyright notice and this permission notice shall be included
|
|
|
|
// in all copies or substantial portions of the Software.
|
|
|
|
//
|
|
|
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
|
|
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
|
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
|
|
|
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
|
|
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
|
|
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
|
|
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
|
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', [
|
|
|
|
/\{\}/
|
|
|
|
]);
|