President Donald Trump’s travel ban was bound to come up during the Senate confirmation hearing for Supreme Court nominee Neil Gorsuch.

But when Sen. Patrick Leahy, the ranking Democrat on the Judiciary Committee, tried to take Gorsuch’s temperature on the pending judicial fight, Gorsuch got testy.

Courts have blocked two separate executive orders that sought to limit travel to the U.S. from several Muslim-majority countries and temporarily halt all refugee resettlement. The Supreme Court, which has been split 4-4 between conservative and liberal justices since Antonin Scalia’s death last year, may hear the Trump administration’s appeal.

Gorsuch admitted as much during the hearing, and Leahy wanted to know which way the nominated judge might rule. “Does the First Amendment allow the use of a religious litmus test for entry into the United States?” the Vermont senator asked.

As is often the case with nominees enduring confirmation hearings, Gorsuch avoided giving a definitive answer. After several minutes of back-and-forth with Leahy, however, he momentarily lost his cool, saying:

Senator, I’m not going to say anything here that would give anybody any idea how I’d rule in that case or any case that could come before the Supreme Court or my court of the 10th Circuit. It would be grossly improper of a judge to do that. It would be a violation of the separation of powers and judicial independence if someone sitting at this table, in order to get confirmed, had to make promises or commitment about how they’d rule in a case that’s currently pending and likely to make its way to the Supreme Court.

In an earlier response, Gorsuch referenced the 2001 Supreme Court case Zadvydas v Davis, which found that the government cannot indefinitely detain an undocumented immigrant. Several of the challenges to Trump’s travel ban cite Zadvydas as support for their claims of discrimination.

“Senator, we have a Constitution, and it does guarantee free exercise,” Gorsuch said. “It also guarantees equal protection of the laws and a whole lot else besides. And the Supreme Court in Zavydas has held that due process rights extend even to undocumented persons in this country. I will apply the law — I will apply the law faithfully and fearlessly and without regard to persons.”

Leahy still wasn’t satisfied. “What about regard to religion?” he asked.

Gorsuch repeated that he will rule fairly and without regard to politics.

Throughout earlier questioning from the Judiciary Committee on both sides of the political divide, Gorsuch repeatedly said he couldn’t reveal his personal feelings on specific cases or issues, saying instead that he would respect precedent.