Added support for options parameter in console.dir()

Signed-off-by: Fedor Indutny <fedor@indutny.com>
This commit is contained in:
Xavi Magrinyà authored and Fedor Indutny committed 2014-06-12 10:33:15 -07:00
1 parent 03e9f84933
commit e00cafa311
3 files changed
+26 -4

No files matched your search

+7 -2
View File
@@ -65,8 +65,13 @@ Console.prototype.warn = function() {
Console.prototype.error = Console.prototype.warn;
Console.prototype.dir = function(object) {
this._stdout.write(util.inspect(object, { customInspect: false }) + '\n');
Console.prototype.dir = function(object, options) {
if (typeof options === 'object' && options !== null) {
options.customInspect = false;
} else {
options = { customInspect: false };
}
this._stdout.write(util.inspect(object, options) + '\n');
};