aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCharles Oliver Nutter <headius@headius.com>2019-07-26 13:37:11 +0800
committeraycabta <aycabta@gmail.com>2019-07-27 16:56:04 +0900
commitf9f02e82166643c1e12f10ac51a0d367ee26ac31 (patch)
tree8c26ed4a460bc09e6a5b755126ae93458f4a63d2
parent58bb7f0ca1468629a379c74f637bdb04e1e5dfe7 (diff)
downloadruby-f9f02e82166643c1e12f10ac51a0d367ee26ac31.tar.gz
Use JRuby equivalent of RubyVM.compile.
RubyVM is specific to CRuby and not supported on JRuby. This is the equivalent operation.
-rw-r--r--lib/irb/ruby-lex.rb7
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/