Access to “parent scope” in JShell
问题 It seems, that JShell object created inside another JShell does not have access to parent's JShell scope. For instance: jshell> int x = 1; x ==> 1 jshell> x x ==> 1 jshell> jdk.jshell.JShell js = jdk.jshell.JShell.create(); js ==> jdk.jshell.JShell@1a052a00 jshell> js.eval("x"); $4 ==> [SnippetEvent(snippet=Snippet:ErroneousKey#1-x,previousStatus=NONEXISTENT,status=REJECTED,isSignatureChange=false,causeSnippetnull)] jshell> js.eval("int x = 2;"); $5 ==> [SnippetEvent(snippet=Snippet