JRuby (please use github issues at http://bugs.jruby.org)
  1. JRuby (please use github issues at http://bugs.jruby.org)
  2. JRUBY-5154

Calling the JRuby parser from Ruby causes a xVarDynamicScope cannot grow exception

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.5.3
    • Fix Version/s: JRuby 1.6RC1
    • Component/s: Java Integration
    • Labels:
      None
    • Number of attachments :
      0

      Description

      The following code causes a FourVarDynamicScope cannot grow exception when used. It suggests using a ManyVarDynamicScope.

      require 'java'
      import 'java.io.File'
      import 'java.io.FileInputStream'
      import 'org.jruby.Ruby'

      def check(file = "test.rb")
      begin
      runtime = Ruby.global_runtime
      io = FileInputStream.new(File.new("/tmp/#

      {file}

      "))
      runtime.parse_from_main(io, file)
      rescue SyntaxError => e
      puts "#

      {e.exception.message}

      "
      end
      end

      This is easily fixed by having the method take a (*args) parameter, but that seems like an ugly workaround.

        Activity

        Hide
        Charles Oliver Nutter added a comment -

        This has been fixed and works on master. Probably some cleanup work on scopes and pushing/popping stuff.

        Show
        Charles Oliver Nutter added a comment - This has been fixed and works on master. Probably some cleanup work on scopes and pushing/popping stuff.
        Hide
        Roger Pack added a comment -

        NB for followers you'll want to close the io variable, here.

        Show
        Roger Pack added a comment - NB for followers you'll want to close the io variable, here.

          People

          • Assignee:
            Charles Oliver Nutter
            Reporter:
            Tim Felgentreff
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: