diff options
author | Charles Oliver Nutter <headius@headius.com> | 2019-07-26 13:37:11 +0800 |
---|---|---|
committer | aycabta <aycabta@gmail.com> | 2019-07-27 16:56:04 +0900 |
commit | f9f02e82166643c1e12f10ac51a0d367ee26ac31 (patch) | |
tree | 8c26ed4a460bc09e6a5b755126ae93458f4a63d2 /lib/irb | |
parent | 58bb7f0ca1468629a379c74f637bdb04e1e5dfe7 (diff) | |
download | ruby-f9f02e82166643c1e12f10ac51a0d367ee26ac31.tar.gz |
Use JRuby equivalent of RubyVM.compile.
RubyVM is specific to CRuby and not supported on JRuby. This is
the equivalent operation.
Diffstat (limited to 'lib/irb')
-rw-r--r-- | lib/irb/ruby-lex.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/irb/ruby-lex.rb b/lib/irb/ruby-lex.rb index 99ab962ff8..fd2e122e1b 100644 --- a/lib/irb/ruby-lex.rb +++ b/lib/irb/ruby-lex.rb @@ -205,7 +205,12 @@ class RubyLex begin # check if parser error are available verbose, $VERBOSE = $VERBOSE, nil - RubyVM::InstructionSequence.compile(code) + case RUBY_ENGINE + when 'jruby' + JRuby.compile_ir(code) + else + RubyVM::InstructionSequence.compile(code) + end rescue SyntaxError => e case e.message when /unterminated (?:string|regexp) meets end of file/ |