resolve = value => {
    if (internalResolve) {
      internalResolve(value);
      internalResolve = null;
      internalReject = null;
    } else {
      assert(internalResolve === null);
    }
  }
@param {import('./types.js').ERef<T>} value