omghax / jruby-sandbox

JRuby VM sandboxes
MIT License
44 stars 26 forks source link

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

Open nilbus opened 11 years ago

nilbus commented 11 years ago
$ 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);