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 <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
  • 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.