--- old/src/jdk/nashorn/tools/Shell.java 2014-05-07 13:40:37.113236468 +0530 +++ new/src/jdk/nashorn/tools/Shell.java 2014-05-07 13:40:36.965235748 +0530 @@ -453,7 +453,7 @@ } } finally { if (globalChanged) { - Context.setGlobal(global); + Context.setGlobal(oldGlobal); } }