Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-3816

Should be possible to declare a class in a script and use it in another script with JSR223

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.7-beta-2, 1.6.6
    • None
    • None

    Description

      This is very useful for use case like XWiki where you want to put a groovy script containing a class in a wiki page and include this page in other documents to use the class.

      Here is a possible test case:

      def engine = new ScriptEngineManager().getEngineByName('groovy')
      
      def clazz = engine.eval('class Foo {}')
      def instance = engine.eval('new Foo()')
      
      assert instance.class.isAssignableFrom(clazz)
      

      Attachments

        Issue Links

          Activity

            People

              guillaume Guillaume Sauthier
              tmortagne Thomas Mortagne
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: