If you play the card Masquerade, and you have zero cards in hand, library and discard, what happens? I assume the person to your left will still have to pass a card along. Do you have to pass a card from play (potentially the Masquerade itself), or does the player to your left receive nothing, essentially reducing his or her deck by one card?
Out of interest, how did you reach the position of having zero cards in hand, library and discard?
Anyway, the answer is fairly simple, I think. Consider the following section of the rules, qualifying the action of "draw 5 cards from your deck":
It seems clear that Dominion follows the same rules philosophy as, for instance, Magic the Gathering: if you cannot fully carry out an action, carry out as much of it as you can.
First, you try to draw 2 cards. You can't, so instead you draw 0 cards.
Next, you try to pass a card left. You can't, so you don't, though you probably do receive a card from your right.
Next, assuming that you were passed a card, you have the option to trash it.
As thesunneversets said, if you have no cards in hand and in your deck when you play dominion, you do not pass a card, but your opponent still has to. This is the key to the dreaded king's court / masquerade lock.
to quote dominionstrategy.com:
The basic ingredients are 2 king's court, goons/militia/ghost ship/outpost, and masquerade.
If these cards are in the kingdom in a 2-player game, the first to get the right combination usually wins the game, no matter how many provinces the other already has.
Setting it up is easier than you may think, if you aggressively use masquerade to trash cards, or have another trasher like chapel to help.
Even if your opponent buys 7 provinces while you set up this combo, once you have it running, your opponent will lose all their victory cards, start every turn with 0 cards and will only be able to buy copper or curses.
Once he has zero cards, you can deplete piles, and get some victory points on the last turn.
Only chance the other player has is getting a huge lead in vp chips before the lock hits, since vp chips cannot be taken away, and your own possibilities to gain vp while executing the combo are strictly limited.
Donald X, the creator of dominion has this to say about the combo: