Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.3.2
-
None
-
None
Description
This is roughly related to GROOVY-5786.
When executing a script in the Groovy ScriptEngine (the JSR223 one) and that script makes changes to the metaclass registry, the modification will be available to the next script.
For example, If I execute
String.metaClass { foobar ={ delegate } } print("Hello".foobar())
the script prints "Hello".
If I execute
print("Hello".foobar())
in the same engine again, it prints "Hello" again. I think it should throw a MissingMethodException.