Skip to content
Browse files

crypto: set `DEFAULT_ENCODING` property to non-enumerable

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: #23222
Fixes: #23203
Reviewed-By: Colin Ihrig <>
Reviewed-By: Guy Bedford <>
Reviewed-By: James M Snell <>
Reviewed-By: Anna Henningsen <>
Reviewed-By: Sakthipriyan Vairamani <>
Reviewed-By: Refael Ackermann <>
Reviewed-By: Tobias Nießen <>
  • Loading branch information...
aduh95 authored and guybedford committed Oct 2, 2018
1 parent 5850220 commit 0f63d84f807edb17466f9357a630467cf608f954
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/crypto.js
@@ -230,7 +230,7 @@ Object.defineProperties(exports, {
fipsForced ? setFipsForced : setFipsCrypto
enumerable: true,
enumerable: false,
configurable: true,
get: deprecate(getDefaultEncoding,
'crypto.DEFAULT_ENCODING is deprecated.', 'DEP0091'),

0 comments on commit 0f63d84

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