Skip to content

Commit

Permalink
Rescue all subtypes of Excepton when eval ruby code (#1568)
Browse files Browse the repository at this point in the history
It avoid exiting repl by pase error.
  • Loading branch information
youchan authored and elia committed Sep 25, 2016
1 parent 0f7d53a commit 9fd5d4e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bin/opal-repl
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ module Opal
code = Opal::Builder.new.build_str(str, '(irb)', :irb => true, :const_missing => true)
code.processed[0...-1].each { |c| @v8.eval(c.to_s) }
@v8.eval "var $_result = #{code.processed.last.to_s} ($_result == null ? 'nil' : $_result.$inspect());"
rescue => e
rescue Exception => e
puts "#{e.message}\n\t#{e.backtrace.join("\n\t")}"
end

Expand Down

0 comments on commit 9fd5d4e

Please sign in to comment.