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: nodejs#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 Trott committed Jun 17, 2019
1 parent 380494f commit 14be3aa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/internal/process/per_thread.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 14be3aa

Please sign in to comment.