Add support for some underscored harmony flags as well #1630
+3
−0
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.
This adds support for both hyphen and underscored flags. (at least a few of them)
Here's my reasoning: I'm trying to run CI tests against several versions of node. (0.10, 0.11, 0.12 and iojs to be precise) I'm using generators in my code, so:
--harmony-generators
--harmony-generators
Rather than doing fancy "version sniffing", I've opted to use a clever shell script to determine if the
node
executable supports the generators flag, and using that to make my determination:Unfortunately, passing this value directly to
mocha
breaks, sincev8-options
uses the underscores instead of the hyphens. (but the node exe definitely acknowledges both in all cases I've tested)tl;dr: I know it's ugly, but I think this pattern will be useful to others while transitioning between node 0.10/11/12+ and iojs. Thanks :)