Skip to content

Commit e517b03

Browse files
BridgeARtargos
authored andcommitted
process: hide NodeEnvironmentFlagsSet's add function
This makes sure that the `add` function is not visible by default when inspecting `process.allowedNodeEnvironmentFlags`. PR-URL: #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]>
1 parent 993c0db commit e517b03

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/internal/process/per_thread.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,9 @@ function buildAllowedFlags() {
263263

264264
// The super constructor consumes `add`, but
265265
// disallow any future adds.
266-
this.add = () => this;
266+
Object.defineProperty(this, 'add', {
267+
value: () => this
268+
});
267269
}
268270

269271
delete() {

0 commit comments

Comments
 (0)