Skip to content
Permalink
Browse files

zlib: make “bare” constants un-enumerable

We prefer for users to use `zlib.constants.XXX` instead of `zlib.XXX`.
Having both enumerable means that inspecting the `zlib` module
shows both variants, making the output significantly longer and
redundant.

PR-URL: #24824
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information...
addaleax committed Dec 4, 2018
1 parent 26b58ea commit 4eee55d354549d08c8224f151159fbcd7d6b2b6e
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/zlib.js
@@ -786,6 +786,6 @@ const bkeys = Object.keys(constants);
for (var bk = 0; bk < bkeys.length; bk++) {
var bkey = bkeys[bk];
Object.defineProperty(module.exports, bkey, {
enumerable: true, value: constants[bkey], writable: false
enumerable: false, value: constants[bkey], writable: false
});
}

0 comments on commit 4eee55d

Please sign in to comment.
You can’t perform that action at this time.