diff options
author | Ruben Bridgewater <ruben@bridgewater.de> | 2019-06-13 17:35:29 +0200 |
---|---|---|
committer | Michaƫl Zasso <targos@protonmail.com> | 2019-07-02 09:07:39 +0200 |
commit | e517b03701732538c129fab76562b557fd46ccaf (patch) | |
tree | e773b623edb78ad02294a73186a33cc4a0327342 /lib | |
parent | 993c0dbf14c342dd0a574a52c9acf5fe76cd65b0 (diff) | |
download | android-node-v8-e517b03701732538c129fab76562b557fd46ccaf.tar.gz android-node-v8-e517b03701732538c129fab76562b557fd46ccaf.tar.bz2 android-node-v8-e517b03701732538c129fab76562b557fd46ccaf.zip |
process: hide NodeEnvironmentFlagsSet's `add` function
This makes sure that the `add` function is not visible by default
when inspecting `process.allowedNodeEnvironmentFlags`.
PR-URL: https://github.com/nodejs/node/pull/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>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/internal/process/per_thread.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/internal/process/per_thread.js b/lib/internal/process/per_thread.js index 35e861df2b..2204d7223b 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() { |