Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: opal/opal
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 6f5017080b0e
Choose a base ref
...
head repository: opal/opal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f6cc8bdfe50f
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Jul 4, 2015

  1. Tiny code style improvements

    bbatsov committed Jul 4, 2015
    Copy the full SHA
    a452973 View commit details
  2. Merge pull request #979 from bbatsov/repl-code-style

    Tiny code style improvements
    elia committed Jul 4, 2015
    Copy the full SHA
    f6cc8bd View commit details
Showing with 3 additions and 3 deletions.
  1. +3 −3 bin/opal-repl
6 changes: 3 additions & 3 deletions bin/opal-repl
Original file line number Diff line number Diff line change
@@ -41,11 +41,11 @@ module Opal

loop do
# on SIGINT lets just return from the loop..
trap("SIGINT") { finish; return }
trap('SIGINT') { finish; return }
line = Readline.readline '>> ', true

# if we type exit, then we need to close down context
if line == "exit" or line.nil?
if line == 'exit' or line.nil?
break
end

@@ -57,7 +57,7 @@ module Opal

def eval_ruby(str)
code = Opal::Builder.new.build_str(str, '(irb)', :irb => true, :const_missing => true)
code.processed[0...-1].each{ |c| @v8.eval(c.to_s) }
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
puts "#{e.message}\n\t#{e.backtrace.join("\n\t")}"