diff options
author | Mark Hansen <mark@markhansen.co.nz> | 2010-02-15 01:11:59 +1300 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2010-02-15 17:08:22 -0800 |
commit | 98e61db21619228e55453eeaab8bb59a3f8eb914 (patch) | |
tree | 68a78bc5db78ac277b1f16e0a9ecfdef0ae952c9 /lib/sys.js | |
parent | 9c6263bff8b7c18b7f5ca1880102d05c5e0a2529 (diff) | |
download | android-node-v8-98e61db21619228e55453eeaab8bb59a3f8eb914.tar.gz android-node-v8-98e61db21619228e55453eeaab8bb59a3f8eb914.tar.bz2 android-node-v8-98e61db21619228e55453eeaab8bb59a3f8eb914.zip |
sys.inspect(Date) now shows the date value
Diffstat (limited to 'lib/sys.js')
-rw-r--r-- | lib/sys.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/sys.js b/lib/sys.js index 581af38dfe..65badcdc05 100644 --- a/lib/sys.js +++ b/lib/sys.js @@ -59,6 +59,11 @@ exports.inspect = function (obj, showHidden) { } } + // Dates without properties can be shortcutted + if (value instanceof Date && keys.length === 0) { + return value.toUTCString(); + } + var base, type, braces; // Determine the object type if (value instanceof Array) { @@ -75,6 +80,11 @@ exports.inspect = function (obj, showHidden) { } else { base = ""; } + + // Make dates with properties first say the date + if (value instanceof Date) { + base = ' ' + value.toUTCString(); + } seen.push(value); |