sys.js: --needless Object.keys() --needless .map() in a single patch
This commit is contained in:
parent
354150f4e1
commit
fc334b3a97
@ -106,13 +106,8 @@ exports.inspect = function (obj, showHidden, depth, colors) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Look up the keys of the object.
|
// Look up the keys of the object.
|
||||||
if (showHidden) {
|
|
||||||
var keys = Object.getOwnPropertyNames(value).map(function (key) { return '' + key; });
|
|
||||||
} else {
|
|
||||||
var keys = Object.keys(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
var visible_keys = Object.keys(value);
|
var visible_keys = Object.keys(value);
|
||||||
|
var keys = showHidden ? Object.getOwnPropertyNames(value) : visible_keys;
|
||||||
|
|
||||||
// Functions without properties can be shortcutted.
|
// Functions without properties can be shortcutted.
|
||||||
if (typeof value === 'function' && keys.length === 0) {
|
if (typeof value === 'function' && keys.length === 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user