This can't work right when interleaved with draw(), can it?  Like if you do eraser(), then you get a message with an incoming draw (non-erase) message, then you move your mouse, you'll that globalCompositeOperation from the other message.