Why would you do such thing? It perhaps wont kill your baby but it will definitely kill you, then the baby will die soon after!
First, you must get out of that depression you're in, thinking about starving yourself. Your baby feels EVERY single one of your emotions, so you need to be happy, or try your best to be happy.
Go to a doctor IMMEDIATELY, tell him/her that you're having suicidal thoughts and that you've been starving yourself. Soon enough you will need to go to therapy to learn to love yourself and your baby.
When you starve yourself, your body will suffer. Right now your body's #1 priority is to take care of the baby. So what happens is, the fluids, minerals and vitamins within your body and bones (the ones you need to be able to survive) are transferred to the baby to keep him/her alive. In which case you'll suffer more than the baby in the early stages.
When your body can no longer find what it needs for the baby within your body; you can get sick, nauseous, headaches, even dry/scratchy throat, and soon you will pass out.
Death is inevitable to you and your baby so make sure you never decide to starve yourself!