src/jdk/nashorn/tools/Shell.java

Print this page




 436                     continue;
 437                 }
 438 
 439                 Object res;
 440                 try {
 441                     res = context.eval(global, source, global, "<shell>", env._strict);
 442                 } catch (final Exception e) {
 443                     err.println(e);
 444                     if (env._dump_on_error) {
 445                         e.printStackTrace(err);
 446                     }
 447                     continue;
 448                 }
 449 
 450                 if (res != ScriptRuntime.UNDEFINED) {
 451                     err.println(JSType.toString(res));
 452                 }
 453             }
 454         } finally {
 455             if (globalChanged) {
 456                 Context.setGlobal(global);
 457             }
 458         }
 459 
 460         return SUCCESS;
 461     }
 462 }


 436                     continue;
 437                 }
 438 
 439                 Object res;
 440                 try {
 441                     res = context.eval(global, source, global, "<shell>", env._strict);
 442                 } catch (final Exception e) {
 443                     err.println(e);
 444                     if (env._dump_on_error) {
 445                         e.printStackTrace(err);
 446                     }
 447                     continue;
 448                 }
 449 
 450                 if (res != ScriptRuntime.UNDEFINED) {
 451                     err.println(JSType.toString(res));
 452                 }
 453             }
 454         } finally {
 455             if (globalChanged) {
 456                 Context.setGlobal(oldGlobal);
 457             }
 458         }
 459 
 460         return SUCCESS;
 461     }
 462 }