ree/jruby safe descendants implementation