process: generate list of allowed env flags programmatically#22638
Closed
addaleax wants to merge 4 commits intonodejs:masterfrom
Closed
process: generate list of allowed env flags programmatically#22638addaleax wants to merge 4 commits intonodejs:masterfrom
addaleax wants to merge 4 commits intonodejs:masterfrom
Conversation
901d187 to
290af4b
Compare
BridgeAR
reviewed
Sep 2, 2018
lib/internal/bootstrap/node.js
Outdated
Member
There was a problem hiding this comment.
I would prefer to pass through filter options into getOptions instead of doing the filtering here.
Since it has a string option at the moment, it would likely be best to accept an object for the options instead.
Another alternative to the current way would be to only iterate once over the entries (this is also nicer to read for me):
const allowedV8EnvironmentFlags = [];
const allowedNodeEnvironmentFlags = [];
for (const [name, info] of options) {
if (info.envVarSettings === kAllowedInEnvironment) {
if (info.type === KV8Option) {
allowedV8EnvironmentFlags.push(name);
} else {
allowedNodeEnvironmentFlags.push(name);
}
}
}
Member
Author
There was a problem hiding this comment.
I’ve gone with the second option for now, but yes, ultimately it might be better to do this in C++ land.
lib/internal/bootstrap/node.js
Outdated
Member
There was a problem hiding this comment.
Nit: retrieving the value multiple times is not necessary.
290af4b to
fa245b8
Compare
jasnell
approved these changes
Sep 4, 2018
Member
Author
Avoids having a separate, second source of truth on this matter.
fa245b8 to
1f37916
Compare
Member
Author
|
New CI: https://ci.nodejs.org/job/node-test-pull-request/17028/ (:heavy_check_mark:) |
BridgeAR
approved these changes
Sep 5, 2018
Member
Author
addaleax
added a commit
that referenced
this pull request
Sep 9, 2018
Avoids having a separate, second source of truth on this matter. PR-URL: #22638 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
addaleax
added a commit
that referenced
this pull request
Sep 9, 2018
PR-URL: #22638 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Member
|
This needs a backport PR to land on |
addaleax
added a commit
that referenced
this pull request
Sep 13, 2018
Avoids having a separate, second source of truth on this matter. PR-URL: #22638 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
addaleax
added a commit
that referenced
this pull request
Sep 13, 2018
PR-URL: #22638 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Avoids having a separate, second source of truth on this matter.
The second diff is best viewed in whitespace-adjusted mode (append
?w=1to GitHub URL).Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes