Browse Source

debugger: support mirroring Date objects

* fixes #3203
v0.9.1-release
Fedor Indutny 13 years ago
parent
commit
c3898f3c1f
  1. 2
      lib/_debugger.js
  2. 4
      test/fixtures/breakpoints.js
  3. 13
      test/simple/test-debugger-repl.js

2
lib/_debugger.js

@ -541,6 +541,8 @@ Client.prototype.mirrorObject = function(handle, depth, cb) {
if (handle.className == 'Array') {
mirror = [];
} else if (handle.className == 'Date') {
mirror = new Date(handle.value);
} else {
mirror = {};
}

4
test/fixtures/breakpoints.js

@ -17,3 +17,7 @@ b();
setInterval(function() {
}, 5000);
now = new Date();
debugger;

13
test/simple/test-debugger-repl.js

@ -143,6 +143,19 @@ addTest('c', [
/\d/, /\d/, /\d/, /\d/, /\d/
]);
addTest('c', [
/break in .*breakpoints.js:\d+/,
/\d/, /\d/, /\d/, /\d/, /\d/
]);
addTest('repl', [
/Press Ctrl \+ C to leave debug repl/
]);
addTest('now', [
/\w* \w* \d* \d* \d*:\d*:\d* GMT[+-]\d* (\w*)/
]);
function finish() {
process.exit(0);
}

Loading…
Cancel
Save