GroovyEvaluator.st
branchdevelopment
changeset 2796 f0c1243363d8
parent 2793 f3cfee185a72
child 3032 590aa6c3cb24
--- a/GroovyEvaluator.st	Sat Oct 05 01:27:31 2013 +0100
+++ b/GroovyEvaluator.st	Sat Oct 05 01:50:46 2013 +0100
@@ -132,6 +132,19 @@
         binding := (JavaVM classForName: 'groovy.lang.Binding') new.
         binding setVariable: 'this' to: receiver.
         binding setVariable: 'self' to: receiver.
+
+        receiver notNil ifTrue:[
+            | instvars |
+
+            instvars := receiver class allInstVarNames.
+            instvars withIndexDo:[:name :index|
+                "/ Skip _lockWord_ - should be hidden...
+                (name ~~ #_lockWord_) ifTrue:[
+                    binding setVariable: name to: (receiver instVarAt: index)
+                ].
+            ].
+        ].
+
         context notNil ifTrue:[
             | pc |
 
@@ -165,7 +178,7 @@
     ^ result class javaUnwrap: result.
 
     "Created: / 17-08-2011 / 08:54:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 04-10-2013 / 22:18:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 05-10-2013 / 01:38:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 moreSharedPools: pools