To finish up this tangent, here is the other reference to “consume” and “lusts” from Moroni’s writings:
20And the reason why he ceaseth to do miracles among the children of men is because that they dwindle in unbelief, and depart from the right way, and know not the God in whom they should trust.
21Behold, I say unto you that whoso believeth in Christ, doubting nothing, whatsoever he shall ask the Father in the name of Christ it shall be granted him; and this promise is unto all, even unto the ends of the earth.
22For behold, thus said Jesus Christ, the Son of God, unto his disciples who should tarry, yea, and also to all his disciples, in the hearing of the multitude: Go ye into all the world, and preach the gospel to every creature;
23And he that believeth and is baptized shall be saved, but he that believeth not shall be damned;
24And these signs shall follow them that believe—in my name shall they cast out devils; they shall speak with new tongues; they shall take up serpents; and if they drink any deadly thing it shall not hurt them; they shall lay hands on the sick and they shall recover;
25And whosoever shall believe in my name, doubting nothing, unto him will I confirm all my words, even unto the ends of the earth.
26And now, behold, who can stand against the works of the Lord? Who can deny his sayings? Who will rise up against the almighty power of the Lord? Who will despise the works of the Lord? Who will despise the children of Christ? Behold, all ye who are despisers of the works of the Lord, for ye shall wonder and perish.
27O then despise not, and wonder not, but hearken unto the words of the Lord, and ask the Father in the name of Jesus for what things soever ye shall stand in need. Doubt not, but be believing, and begin as in times of old, and come unto the Lord with all your heart, and work out your own salvation with fear and trembling before him.
28Be wise in the days of your probation; strip yourselves of all uncleanness; ask not, that ye may consume it on your lusts, but ask with a firmness unshaken, that ye will yield to no temptation, but that ye will serve the true and living God.
So that was a lot to put in a block quote, but I’m trying to figure out how to summarize what the context is. I think it is significant that Moroni is talking about miracles/signs/gifts in this chapter, but I can’t say for sure that verse 28 is referring to gifts of the spirit when he says, “ask not, that ye may consume it on your lusts.” Perhaps he is juxtaposing asking for anything for yourself with asking to simply serve God and resist temptation.
James has a lot of things I’d like to take the time to work through, but I’m afraid I’ll veer too far off my path and have a hard time getting focused on my paper again. So for now, I’ll say that I think James 4:3 is also criticizing selfishness in general. The context seems to be the contentions people were having with each other for worldly things. They fight, because they don’t have what they want. They also don’t ask. But when they do ask, they only ask to consume it upon their lusts, therefore, they do not receive.
So it seems to be a general statement of selfishness and why a prayer isn’t answered, rather than specifically referring to asking for a spiritual gift. D&C 46 takes up the language to apply it to the specific circumstance of asking for a spiritual manifestation.