From c3898f3c1fb2aa75a0aa6f751dfc3b602871e07e Mon Sep 17 00:00:00 2001 From: Fedor Indutny Date: Wed, 2 May 2012 12:30:23 +0700 Subject: [PATCH] debugger: support mirroring Date objects * fixes #3203 --- lib/_debugger.js | 2 ++ test/fixtures/breakpoints.js | 4 ++++ test/simple/test-debugger-repl.js | 13 +++++++++++++ 3 files changed, 19 insertions(+) diff --git a/lib/_debugger.js b/lib/_debugger.js index f1da313ab7..bb108347d4 100644 --- a/lib/_debugger.js +++ b/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 = {}; } diff --git a/test/fixtures/breakpoints.js b/test/fixtures/breakpoints.js index 8445558df9..4824767ff0 100644 --- a/test/fixtures/breakpoints.js +++ b/test/fixtures/breakpoints.js @@ -17,3 +17,7 @@ b(); setInterval(function() { }, 5000); + + +now = new Date(); +debugger; diff --git a/test/simple/test-debugger-repl.js b/test/simple/test-debugger-repl.js index 19ff12e3cd..14092bc4a2 100644 --- a/test/simple/test-debugger-repl.js +++ b/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); }