Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Change colors to identify hidden constants from enumerable constants,…

… rearrange the type colors a bit to work better.
  • Loading branch information...
commit be86f47ce723b0aa5a7f20aa7d6bcb167919fbb3 1 parent ff213b9
Brandon Benvie authored December 23, 2011

Showing 1 changed file with 14 additions and 13 deletions. Show diff stats Hide diff stats

  1. 27  lib/util.js
27  lib/util.js
@@ -140,31 +140,31 @@ var ansi = {
140 140
 // map types to a color
141 141
 var styles = {
142 142
   // falsey
143  
-  Undefined   : 'boldblack',
144  
-  Null        : 'boldblack',
  143
+  Undefined   : 'white',
  144
+  Null        : 'white',
145 145
   // constructor functions
146 146
   Constructor : 'boldyellow',
147 147
   // normal types
148 148
   Function    : 'boldmagenta',
149  
-  Boolean     : 'magenta',
150  
-  Date        : 'red',
  149
+  Boolean     : 'boldyellow',
  150
+  Date        : 'boldred',
151 151
   Error       : 'boldred',
152 152
   Number      : 'yellow',
153  
-  RegExp      : 'red',
  153
+  RegExp      : 'boldred',
154 154
   // proprty names and strings
155 155
   HString     : 'green',
156 156
   String      : 'boldgreen',
157 157
   HConstant   : 'cyan',
158  
-  Constant    : 'cyan',
  158
+  Constant    : 'boldcyan',
159 159
   HName       : 'boldblack',
160 160
   Name        : 'boldwhite',
161 161
   // meta-labels
162  
-  More        : 'boldcyan',
163  
-  Accessor    : 'boldcyan',
164  
-  Circular    : 'boldcyan',
  162
+  More        : 'red',
  163
+  Accessor    : 'magenta',
  164
+  Circular    : 'red',
165 165
   // brackets
166  
-  Square      : 'boldblue',
167  
-  Curly       : 'cyan'
  166
+  Square      : 'white',
  167
+  Curly       : 'white'
168 168
 };
169 169
 
170 170
 
@@ -290,7 +290,8 @@ function formatValue(value, depth, settings) {
290 290
     base = settings.style(formatters[type](value), type);
291 291
   }
292 292
   // prevent deeper inspection for primitives, regexps, and errors
293  
-  if (isPrimitive(value) || type === 'RegExp' || type === 'Error') {
  293
+  if (isPrimitive(value) ||
  294
+      !settings.showHidden && type === 'RegExp' || type === 'Error') {
294 295
     return base;
295 296
   }
296 297
 
@@ -412,7 +413,7 @@ function formatProperty(value, key, depth, settings, array) {
412 413
   if (/^[a-zA-Z_\$][a-zA-Z0-9_\$]*$/.test(key)) {
413 414
     // valid JavaScript name not requiring quotes
414 415
 
415  
-    if ((val.value && !val.writable) || (val.get && !val.set)) {
  416
+    if (val.value && !val.writable) {
416 417
       // color non-writable differently
417 418
       nameFormat += 'Constant';
418 419
     } else {

0 notes on commit be86f47

Please sign in to comment.
Something went wrong with that request. Please try again.