Skip to content

Commit

Permalink
process: hide NodeEnvironmentFlagsSet's add function
Browse files Browse the repository at this point in the history
This makes sure that the `add` function is not visible by default
when inspecting `process.allowedNodeEnvironmentFlags`.

PR-URL: #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>
  • Loading branch information
BridgeAR authored and targos committed Jul 2, 2019
1 parent 993c0db commit e517b03
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/internal/process/per_thread.js
Expand Up @@ -263,7 +263,9 @@ function buildAllowedFlags() {


// The super constructor consumes `add`, but // The super constructor consumes `add`, but
// disallow any future adds. // disallow any future adds.
this.add = () => this; Object.defineProperty(this, 'add', {
value: () => this
});
} }


delete() { delete() {
Expand Down

0 comments on commit e517b03

Please sign in to comment.