Skip to content
Permalink
Browse files

zlib: use for...of

PR-URL: #31051
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
trivikr authored and BridgeAR committed Dec 21, 2019
1 parent 8491e1c commit 10f7169d5826c581d46c85af20c3be9337aab4c7
Showing with 2 additions and 6 deletions.
  1. +2 −6 lib/zlib.js
@@ -91,9 +91,7 @@ const codes = {
Z_VERSION_ERROR: constants.Z_VERSION_ERROR
};

const ckeys = ObjectKeys(codes);
for (let ck = 0; ck < ckeys.length; ck++) {
const ckey = ckeys[ck];
for (const ckey of ObjectKeys(codes)) {
codes[codes[ckey]] = ckey;
}

@@ -911,9 +909,7 @@ ObjectDefineProperties(module.exports, {

// These should be considered deprecated
// expose all the zlib constants
const bkeys = ObjectKeys(constants);
for (let bk = 0; bk < bkeys.length; bk++) {
const bkey = bkeys[bk];
for (const bkey of ObjectKeys(constants)) {
if (bkey.startsWith('BROTLI')) continue;
ObjectDefineProperty(module.exports, bkey, {
enumerable: false, value: constants[bkey], writable: false

0 comments on commit 10f7169

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