code: func (re *JSRE) Stop(waitForCallbacks bool) {
  	select {
  	case <-re.closed:
  	case re.stopEventLoop <- waitForCallbacks:
  		<-re.closed
  	}
  }
docs: // stops the event loop before exit, optionally waits for all timers to expire