Skip to content

fix ExecJS::Runtimes.from_environment #5

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

Closed

Conversation

timoschilling
Copy link

port of sstephenson#156

The current implementation of ExecJS::Runtimes.from_environment has two bad things:

  1. The elsif branch can never reached, while the if const_get will raise a exception. So we should fix it by using a rescue.
  2. There is a doubled if

else
raise RuntimeUnavailable, "#{runtime.name} runtime is not available on this system"
end
elsif !name.empty?
rescue
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we rescue the specific exception?

@helsus helsus mentioned this pull request Apr 9, 2015
@rafaelfranca
Copy link
Member

Fixed on master

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.

2 participants