From d87b64767ce6c0f362f164090fb86a8759f60025 Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Thu, 13 Jun 2019 17:35:29 +0200 Subject: [PATCH] process: hide NodeEnvironmentFlagsSet's `add` function This makes sure that the `add` function is not visible by default when inspecting `process.allowedNodeEnvironmentFlags`. --- lib/internal/process/per_thread.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/internal/process/per_thread.js b/lib/internal/process/per_thread.js index 35e861df2b73f9..2204d7223bf344 100644 --- a/lib/internal/process/per_thread.js +++ b/lib/internal/process/per_thread.js @@ -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() {