From 2e98c51571d2455ead729fe0bd67d757d17bfda0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= Date: Thu, 15 Jan 2015 08:45:52 +0100 Subject: [PATCH] Fix detection of `util.inspect` version Improve the detection to work in browser too. This fixes a regression introduced in e4fc3878. --- lib/model.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/model.js b/lib/model.js index 916e09d5..543af043 100644 --- a/lib/model.js +++ b/lib/model.js @@ -441,8 +441,9 @@ ModelBaseClass.prototype.reset = function () { // Node v0.11+ allows custom inspect functions to return an object // instead of string. That way options like `showHidden` and `colors` // can be preserved. -var versionParts = process.versions.node - .split(/\./g).map(function(v) { return +v; }); +var versionParts = process.versions && process.versions.node ? + process.versions.node.split(/\./g).map(function(v) { return +v; }) : + [1, 0, 0]; // browserify ships 1.0-compatible version of util.inspect var INSPECT_SUPPORTS_OBJECT_RETVAL = versionParts[0] > 0 ||