code: public static void exit()
      {
          Object helper = VMBridge.instance.getThreadContextHelper();
          Context cx = VMBridge.instance.getContext(helper);
          if (cx == null) {
              throw new IllegalStateException(
                  "Calling Context.exit without previous Context.enter");
          }
          if (cx.enterCount < 1) Kit.codeBug();
          if (--cx.enterCount == 0) {
              VMBridge.instance.setContext(helper, null);
              cx.factory.onContextReleased(cx);
          }
      }
docs: Exit a block of code requiring a Context.
  
  Calling <code>exit()</code> will remove the association between
  the current thread and a Context if the prior call to
  {@link ContextFactory#enterContext()} on this thread newly associated a
  Context with this thread. Once the current thread no longer has an
  associated Context, it cannot be used to execute JavaScript until it is
  again associated with a Context.
  @see ContextFactory#enterContext()