Unverified Commit 90e8f79f authored by Bryan English's avatar Bryan English Committed by Ruben Bridgewater
Browse files

constants: freeze the constants object

Constants ought to be constant. The primary goal of this commit is to
make constants exposed in require('constants') immutable, as they were
prior to node@7.0.0, and as the constants exposed on fs.constants,
crypto.constants, etc. are.

Since this is implemented by using Object.freeze, it also has the side
effect of making the entire exports of require('constants') immutable,
so no new constants can be defined on the object in userland.

PR-URL: https://github.com/nodejs/node/pull/19813


Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
Reviewed-By: default avatarTiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: default avatarRich Trott <rtrott@gmail.com>
Reviewed-By: default avatarGus Caplan <me@gus.host>
Reviewed-By: default avatarRuben Bridgewater <ruben@bridgewater.de>
Reviewed-By: default avatarAli Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: default avatarMatteo Collina <matteo.collina@gmail.com>
parent 8444bba0
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment