Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
lib/util: use const for symbolKeys & enumSymbolKeys
  • Loading branch information
mightyiam committed Nov 24, 2016
commit 8e73c9501c0a4e88fbfd933ddc6ef1ebc0b50ad3
4 changes: 2 additions & 2 deletions lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,8 @@ function formatValue(ctx, value, recurseTimes) {
// Look up the keys of the object.
var keys = Object.keys(value);
var visibleKeys = arrayToHash(keys);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't fully understand what goes on with keys vs. visibleKeys, yet, this seems to work.

var symbolKeys = Object.getOwnPropertySymbols(value);
var enumSymbolKeys = symbolKeys
const symbolKeys = Object.getOwnPropertySymbols(value);
const enumSymbolKeys = symbolKeys
.filter((key) => value.propertyIsEnumerable(key));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I think we generally indent statement continuations by 4 spaces, not 2

keys = keys.concat(enumSymbolKeys);

Expand Down