-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zlib: refactor constants for consistency #7203
Conversation
@@ -123,7 +123,7 @@ method that is used to compressed the last chunk of input data: | |||
// This is a truncated version of the buffer from the above examples | |||
const buffer = Buffer.from('eJzT0yMA', 'base64'); | |||
|
|||
zlib.unzip(buffer, { finishFlush: zlib.Z_SYNC_FLUSH }, (err, buffer) => { | |||
zlib.unzip(buffer, {finishFlush: zlib.constantsZ_SYNC_FLUSH}, (err, buffer) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: missing .
@addaleax ... nit fixed! |
@nodejs/ctc ... please review. This includes a docs only deprecation. |
👍 for consistency, lgtm commit message could be more clear about what's going on to make it easier to spot when scanning the changelog |
If this is a docs-only deprecation, why is this a semver-major? |
@mscdex ... we've generally treated docs-only deprecations as semver-major. In the previous update for require('constants'), we did it as semver-minor because the constants module wasn't actually documented. In this case, the zlib.md actually already documented the constants. |
zlib constants were previously being added to binding in node_zlib.cc. This moves the zlib constants to node_constants.cc for consistency with the recent constants refactoring: nodejs#6534 Adds require('zlib').constants to expose the constants Docs-only deprecates the constants hung directly off require('zlib') Removes a couple constants from the docs that apparently no longer exist in the code
@rvagg: commit log updated. CI: https://ci.nodejs.org/job/node-test-pull-request/2958/ ... Green |
LGTM |
Thank you! will land tomorrow barring any other issues. |
@bnoordhuis ... can I ask you to take a look at this quickly? Any nits with the node_constants.cc changes? |
NODE_DEFINE_CONSTANT(target, INFLATERAW); | ||
NODE_DEFINE_CONSTANT(target, UNZIP); | ||
|
||
#define Z_MIN_WINDOWBITS 8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't indent preprocessor directives.
@bnoordhuis .. updated! |
LGTM |
zlib constants were previously being added to binding in node_zlib.cc. This moves the zlib constants to node_constants.cc for consistency with the recent constants refactoring: #6534 Adds require('zlib').constants to expose the constants Docs-only deprecates the constants hung directly off require('zlib') Removes a couple constants from the docs that apparently no longer exist in the code PR-URL: #7203 Reviewed-By: Rod Vagg <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
Landed in 197a465 |
Some constants in the zlib docs are not in the actual code: zlib.Z_BINARY zlib.Z_TEXT zlib.Z_ASCII zlib.Z_UNKNOWN Also handled in nodejs#7203, but marked as semver-major, so will not land in v6.x. Fixes: nodejs#7204
Some constants in the zlib docs are not in the actual code: zlib.Z_BINARY zlib.Z_TEXT zlib.Z_ASCII zlib.Z_UNKNOWN Also handled in #7203, but marked as semver-major, so will not land in v6.x. Fixes: #7204 PR-URL: #7520 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]>
Some constants in the zlib docs are not in the actual code: zlib.Z_BINARY zlib.Z_TEXT zlib.Z_ASCII zlib.Z_UNKNOWN Also handled in #7203, but marked as semver-major, so will not land in v6.x. Fixes: #7204 PR-URL: #7520 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]>
Some constants in the zlib docs are not in the actual code: zlib.Z_BINARY zlib.Z_TEXT zlib.Z_ASCII zlib.Z_UNKNOWN Also handled in #7203, but marked as semver-major, so will not land in v6.x. Fixes: #7204 PR-URL: #7520 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]>
Some constants in the zlib docs are not in the actual code: zlib.Z_BINARY zlib.Z_TEXT zlib.Z_ASCII zlib.Z_UNKNOWN Also handled in #7203, but marked as semver-major, so will not land in v6.x. Fixes: #7204 PR-URL: #7520 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]>
Some constants in the zlib docs are not in the actual code: zlib.Z_BINARY zlib.Z_TEXT zlib.Z_ASCII zlib.Z_UNKNOWN Also handled in #7203, but marked as semver-major, so will not land in v6.x. Fixes: #7204 PR-URL: #7520 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]>
Checklist
make -j4 test
(UNIX) orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
zlib
Description of change
refactor zlib constants for consistency with the changes to
constants in fs, os etc. Adds a new
zlib.constants
, docs-onlydeprecation for the constants hanging directly off
zlib
, movesthe constants decls from node_zlib.cc into node_constants.cc, and
removes a couple of constants from the docs that apparently no longer
exist in the code any where (surprise!)
/cc @addaleax