Skip to content

Commit

Permalink
Fix for empty EXECJS_RUNTIME
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed Sep 25, 2017
1 parent 406b917 commit 562c941
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/execjs/runtimes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ def self.best_available
end

def self.from_environment
if name = ENV["EXECJS_RUNTIME"]
env = ENV["EXECJS_RUNTIME"]
if env && !env.empty?
name = env
raise RuntimeUnavailable, "#{name} runtime is not defined" unless const_defined?(name)
runtime = const_get(name)

Expand Down

0 comments on commit 562c941

Please sign in to comment.