Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for some underscored harmony flags as well #1630

Merged
merged 1 commit into from
Jun 5, 2015

Conversation

dominicbarnes
Copy link
Contributor

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:

  • iojs breaks if I add --harmony-generators
  • 0.11 and 0.12 require --harmony-generators
  • 0.10 doesn't support generators at all, but I'm using gnode as a last-resort fallback

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:

$ node --v8-options | grep generators | cut -d ' ' -f 3
--harmony_generators

Unfortunately, passing this value directly to mocha breaks, since v8-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 :)

@dasilvacontin dasilvacontin added the status: waiting for author waiting on response from OP - more information needed label Mar 27, 2015
@jbnicolai
Copy link

Let's hope we can remove this in the near future, with iojs and node merging. But for now: looks like a good fix, and thanks for the explanation!

jbnicolai pushed a commit that referenced this pull request Jun 5, 2015
Add support for some underscored harmony flags as well
@jbnicolai jbnicolai merged commit d10a196 into mochajs:master Jun 5, 2015
@boneskull boneskull removed the status: waiting for author waiting on response from OP - more information needed label Dec 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants