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

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.7-beta-2, 1.6.6
    • Component/s: None
    • Labels:
      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

              • Assignee:
                Guillaume Guillaume Delcroix
                Reporter:
                tmortagne Thomas Mortagne
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: