Fix detection of `util.inspect` version
Improve the detection to work in browser too. This fixes a regression
introduced in e4fc3878
.
This commit is contained in:
parent
4aeb831bd5
commit
2e98c51571
|
@ -441,8 +441,9 @@ ModelBaseClass.prototype.reset = function () {
|
||||||
// Node v0.11+ allows custom inspect functions to return an object
|
// Node v0.11+ allows custom inspect functions to return an object
|
||||||
// instead of string. That way options like `showHidden` and `colors`
|
// instead of string. That way options like `showHidden` and `colors`
|
||||||
// can be preserved.
|
// can be preserved.
|
||||||
var versionParts = process.versions.node
|
var versionParts = process.versions && process.versions.node ?
|
||||||
.split(/\./g).map(function(v) { return +v; });
|
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 =
|
var INSPECT_SUPPORTS_OBJECT_RETVAL =
|
||||||
versionParts[0] > 0 ||
|
versionParts[0] > 0 ||
|
||||||
|
|
Loading…
Reference in New Issue