docs: public static void main(String args[]) {
          // Associate a new Context with this thread
          Context cx = Context.enter();
          try {
              // Initialize the standard objects (Object, Function, etc.)
              // This must be done before scripts can be executed.
              Shell shell = new Shell();
              cx.initStandardObjects(shell);
  
              // Define some global functions particular to the shell. Note
              // that these functions are not part of ECMA.
              String[] names = { "print", "quit", "version", "load", "help" };
              shell.defineFunctionProperties(names, Shell.class,
                                             ScriptableObject.DONTENUM);
  
              args = processOptions(cx, args);
  
              // Set up "arguments" in the global scope to contain the command
              // line arguments after the name of the script to execute
              Object[] array;
              if (args.length == 0) {
                  array = new Object[0];
              } else {
                  int length = args.length - 1;
                  array = new Object[length];
                  System.arraycopy(args, 1, array, 0, length);
              }
              Scriptable argsObj = cx.newArray(shell, array);
              shell.defineProperty("arguments", argsObj,
                                   ScriptableObject.DONTENUM);
  
              shell.processSource(cx, args.length == 0 ? null : args[0]);
          } finally {
              Context.exit();
          }
      }