function await_block(payload, promise, pending_fn, then_fn) {
	if (is_promise(promise)) {
		payload.out += BLOCK_OPEN;
		promise.then(null, noop);
		if (pending_fn !== null) {
			pending_fn();
		}
	} else if (then_fn !== null) {
		payload.out += BLOCK_OPEN_ELSE;
		then_fn(promise);
	}
}
@template V
@param {Payload} payload
@param {Promise<V>} promise
@param {null | (() => void)} pending_fn
@param {(value: V) => void} then_fn
@returns {void}