Skip to content

Commit

Permalink
crypto: set DEFAULT_ENCODING property to non-enumerable
Browse files Browse the repository at this point in the history
Since it is a deprecated API, a deprecation warning is printed when
loading crypto module from ESM. Making it non enumerable remove the
deprecation warning and make the API non-available to named imports.

PR-URL: nodejs#23222
Fixes: nodejs#23203
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Guy Bedford <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
  • Loading branch information
aduh95 authored and kiyomizumia committed Nov 15, 2018
1 parent 31921e2 commit 077ae16
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/crypto.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ Object.defineProperties(exports, {
fipsForced ? setFipsForced : setFipsCrypto
},
DEFAULT_ENCODING: {
enumerable: true,
enumerable: false,
configurable: true,
get: deprecate(getDefaultEncoding,
'crypto.DEFAULT_ENCODING is deprecated.', 'DEP0091'),
Expand Down

0 comments on commit 077ae16

Please sign in to comment.