Skip to content

Commit

Permalink
Make opal-repl handle undefined references better
Browse files Browse the repository at this point in the history
  • Loading branch information
adambeynon committed Oct 6, 2013
1 parent cebaaef commit 29dac59
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bin/opal-repl
Expand Up @@ -49,7 +49,7 @@ module Opal

def eval_ruby(str)
code = @builder.build_str str, :irb => true
@v8.eval "var $_result = #{code} $_result.$inspect();"
@v8.eval "var $_result = #{code} ($_result == null ? 'nil' : $_result.$inspect());"
rescue => e
puts "#{e.message}\n\t#{e.backtrace.join("\n\t")}"
end
Expand Down

0 comments on commit 29dac59

Please sign in to comment.