Details

    • Number of attachments :
      0

      Description

      I had an issue recently which forced me to revert to back to jruby-1.6.5.1 from jruby-1.6.7

      jruby-1.6.7 :001 >  s = "{ :summary =>'some text\n\r\n\nPlease be sure to include your:\n\r\n  \r\nfull name \r\n \r\nemail address \r', :keywords=>'premium services'}"
       
       => "{ :summary =>'some text\n\r\n\nPlease be sure to include your:\n\r\n  \r\nfull name \r\n \r\nemail address \r', :keywords=>'premium services'}" 
      
      jruby-1.6.7 :002 > eval(s)
      
      SyntaxError: (eval):9: syntax error, unexpected tIDENTIFIER
      
      ', :keywords=>'premium services'}
                                          ^
      	from org/jruby/RubyKernel.java:1088:in `eval'
      	from (irb):2:in `evaluate'
      	from org/jruby/RubyKernel.java:1088:in `eval'
      	from org/jruby/RubyKernel.java:1410:in `loop'
      	from org/jruby/RubyKernel.java:1197:in `catch'
      	from org/jruby/RubyKernel.java:1197:in `catch'
      	from /home/ubuntu/.rvm/rubies/jruby-1.6.7/bin/jirb:17:in `(root)'
      

      The above behaviour also occurs in 1.6.6

      In jruby-1.6.5.1 all is well:

      jruby-1.6.5.1 :001 > s = "{ :summary =>'some text\n\r\n\nPlease be sure to include your:\n\r\n  \r\nfull name \r\n \r\nemail address \r', :keywords=>'premium services'}"
       
       => "{ :summary =>'some text\n\r\n\nPlease be sure to include your:\n\r\n  \r\nfull name \r\n \r\nemail address \r', :keywords=>'premium services'}" 
      
      jruby-1.6.5.1 :002 > eval(s)
       
       => {:summary=>"some text\n\n\nPlease be sure to include your:\n\n  \nfull name \n \nemail address \n", :keywords=>"premium services"} 
      
      

        Issue Links

          Activity

          Hide
          Hiro Asari added a comment -

          It is not eval that is broken. (I changed the summary to more accurately describe the problem.) What is broken is how '\r' is treated. This is due to the work I did for JRUBY-6344.

          As a workaround, please avoid a string-ending '\r'.

          irb(main):002:0> RUBY_DESCRIPTION
          => "jruby 1.6.7 (ruby-1.8.7-p357) (2012-03-18 9002961) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_29) [darwin-x86_64-java]"
          irb(main):003:0> s = "{ :summary =>'some text\n\r\n\nPlease be sure to include your:\n\r\n \r\nfull name \r\n \r\nemail address \r\n', :keywords=>'premium services'}"
          => "{ :summary =>'some text\n\r\n\nPlease be sure to include your:\n\r\n \r\nfull name \r\n \r\nemail address \r\n', :keywords=>'premium services'}"
          irb(main):004:0> eval s
          => {:summary=>"some text\n\n\nPlease be sure to include your:\n\n \nfull name \n \nemail address \n", :keywords=>"premium services"}
          
          Show
          Hiro Asari added a comment - It is not eval that is broken. (I changed the summary to more accurately describe the problem.) What is broken is how '\r' is treated. This is due to the work I did for JRUBY-6344 . As a workaround, please avoid a string-ending '\r'. irb(main):002:0> RUBY_DESCRIPTION => "jruby 1.6.7 (ruby-1.8.7-p357) (2012-03-18 9002961) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_29) [darwin-x86_64-java]" irb(main):003:0> s = "{ :summary =>'some text\n\r\n\nPlease be sure to include your:\n\r\n \r\nfull name \r\n \r\nemail address \r\n', :keywords=>'premium services'}" => "{ :summary =>'some text\n\r\n\nPlease be sure to include your:\n\r\n \r\nfull name \r\n \r\nemail address \r\n', :keywords=>'premium services'}" irb(main):004:0> eval s => {:summary=>"some text\n\n\nPlease be sure to include your:\n\n \nfull name \n \nemail address \n", :keywords=>"premium services"}
          Hide
          Hiro Asari added a comment -

          Fixed in 515bc51 on 1.6 branch, 90f3163 on master.

          Show
          Hiro Asari added a comment - Fixed in 515bc51 on 1.6 branch, 90f3163 on master.

            People

            • Assignee:
              Hiro Asari
              Reporter:
              Frazer
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: