process: hide NodeEnvironmentFlagsSet's add function

This makes sure that the `add` function is not visible by default
when inspecting `process.allowedNodeEnvironmentFlags`.

PR-URL: https://github.com/nodejs/node/pull/28206
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
Ruben Bridgewater 2019-06-13 17:35:29 +02:00 committed by Rich Trott
parent 380494f022
commit 14be3aa6e6

View File

@ -263,7 +263,9 @@ function buildAllowedFlags() {
// The super constructor consumes `add`, but
// disallow any future adds.
this.add = () => this;
Object.defineProperty(this, 'add', {
value: () => this
});
}
delete() {