This repository was archived by the owner on Mar 3, 2023. It is now read-only.
bootstrap: Use legacy-compatible catch syntax (support older Node)
#22979
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.
Requirements for Contributing a Bug Fix (from template, click to expand)
Identify the Bug
Fixes #22969
Description of the Change
catchsyntax inscript/lib/verify-machine-requirements.jsthat is backward-compatible with older Node (9 and older)catch {}blocks without needing to bind the exception. Older Node requires the exception to be bound, like this:catch (exceptionVarName) {}.Side note:
try/catchblock syntax! (Bootstrap syntax error #22969).Alternate Designs
None.
Possible Drawbacks
Allows the rather outdated Node check to function as written.
The Node version check should be updated... Please consider merging #23001 along with this PR.
Verification Process
script/bootstrapandscript/buildon Node 9 and older.Result: Users with Node older than 10 who run
script/bootstrap(orscript/build) can now get through the earliest part,script/lib/verify-machine-requirements.js, without encountering syntax errors. That means the script can properly do its job of detecting build dependency versions and printing their version numbers... and/or printing warnings or errors if the versions are too old to build Atom.Release Notes
N/A