mirror of
https://github.com/rails/execjs
synced 2023-03-27 23:21:20 -04:00
Move runtime error to ExecJS.runtime
This commit is contained in:
parent
abc20a3678
commit
313a2903cb
2 changed files with 3 additions and 2 deletions
|
@ -27,7 +27,8 @@ module ExecJS
|
|||
end
|
||||
|
||||
def self.runtime
|
||||
@runtime ||= Runtimes.best_available
|
||||
@runtime ||= Runtimes.best_available ||
|
||||
raise(ExecJS::RuntimeError, "Could not find a JavaScript runtime")
|
||||
end
|
||||
|
||||
def self.root
|
||||
|
|
|
@ -31,7 +31,7 @@ module ExecJS
|
|||
|
||||
|
||||
def self.best_available
|
||||
runtimes.find(&:available?) or raise(ExecJS::RuntimeError, 'Could not find any JavaScript runtime!')
|
||||
runtimes.find(&:available?)
|
||||
end
|
||||
|
||||
def self.runtimes
|
||||
|
|
Loading…
Add table
Reference in a new issue