Moses
Genesis 38:10BSB·traditional attribution

What he did was wicked in the sight of the LORD, so He put Onan to death as well.

John Calvin Reformed @genevareformer

10. And the thing which he did displeased the LORD. Less neatly the Jews speak about this matter. I will contend myself with briefly mentioning this, as far as the sense of shame allows to discuss it. It is a horrible thing to pour out seed besides the intercourse of man and woman. Deliberately avoiding the intercourse, so that the seed drops on the ground, is double horrible.

Matthew Henry Presbyterian @wholebiblehenry

Here is, 1. Judah's foolish friendship with a Canaanite-man. He went down from his brethren, and withdrew for a time from their society and his father's family, and got to be intimately acquainted with one Hirah, an Adullamite, Gen 38:1. It is computed that he was now not much above fifteen or sixteen years of age, an easy prey to the tempter.

Commenting on Genesis 38:1-11

John Gill Reformed Baptist @doctorgill

Then said Judah to Tamar his daughter in law,.... After the death of his two sons, who had successively married her: remain a widow at thy father's house till Shelah my son be grown: who was his third and youngest son, though perhaps not more than a year younger than Onan; but he might not choose he should marry so soon as his brethren had...