וַיָּ֤שֶׂם דָּנִיֵּאל֙ עַל־לִבּ֔וֹ אֲשֶׁ֧ר לֹֽא־יִתְגָּאַ֛ל בְּפַתְבַּ֥ג הַמֶּ֖לֶךְ וּבְיֵ֣ין מִשְׁתָּ֑יו וַיְבַקֵּשׁ֙ מִשַּׂ֣ר הַסָּרִיסִ֔ים אֲשֶׁ֖ר לֹ֥א יִתְגָּאָֽל׃
다니엘은 뜻을 정하여 왕의 진미와 그의 마시는 포도주로 자기를 더럽히지 아니하리라 하고 자기를 더럽히지 않게 하기를 환관장에게 구하니
Chizkuni
ויאמר בלבו, “He said to himself:” the expression ויאמר בלבו, as in Genesis 27,41 about Esau, or in Esther 6,6 where it is used about Haman, is typical for wicked people; on the other hand, when a similar expression is used in connection with righteous people the formulation is: ויאמר על לבו, as in Samuel I 27,1 in connection with David, or in Daniel 1,8 in connection with Daniel. The reason for this change in formulation is that the righteous are allowed to carry out their plans, i.e. what is in their hearts, as they are in charge of their hearts, whereas the wicked only think that they will be able to carry out their plans. The reason that in connection with Avraham the former formulation is used, is because the reader of these words is apt to think that even Avraham doubted G-d’s promise.
Rabbeinu Bahya
ויאמר עשו בלבו, “Esau said to himself, etc.” Our sages in Bereshit Rabbah 67,8 used this phrase to remind us that the wicked are always “prisoners” of the dictates of their hearts, whereas the righteous are in full control of their hearts. We have a number of verses speaking of wicked people in which the Bible uses the same expression. Examples are: Psalms 14,1: “Naval said in his heart,” (to himself), Jerobam said to himself (Kings I 12,26) et al. The word בלבו must be contrasted with the expression אל לבו, “to his heart,” as distinct from “in his heart.” When you speak “to your heart,” you are the boss. When a voice speaks “in your heart,” the heart is the boss. This why we find in Samuel I 1,13 where Chanah is praying that the wording used to describe this is וחנה היא מדברת אל לבה, “and Chanah, she was speaking to her heart.” When G’d is reported as speaking to Himself in Genesis 5,21 the wording used is also ויאמר ה’ אל לבו.