jruby-sandbox icon indicating copy to clipboard operation
jruby-sandbox copied to clipboard

All eval'd code is run in Ruby 1.9 mode regardless

Open nilbus opened this issue 12 years ago • 0 comments

$ jruby --1.8 -S irb
jruby-1.6.7.2 :001 > require 'rubygems'
 => true
jruby-1.6.7.2 :002 > require 'sandbox'
 => true
jruby-1.6.7.2 :003 > Sandbox::Full.new.eval("{new_hash_syntax: true}")
 => {:new_hash_syntax=>true}
jruby-1.6.7.2 :004 > {new_hash_syntax: true}
SyntaxError: (irb):4: syntax error, unexpected ':'

This is causing problems because my app and the gems it uses currently run in 1.8 mode only.

The offending line in SandboxFull.java:38

cfg.setCompatVersion(CompatVersion.RUBY1_9);

nilbus avatar May 19 '13 03:05 nilbus