But five months later, she has woken from her coma and was yesterday recovering from a pioneering operation which is extremely rare for people of her age and condition.
She is the first child in Scotland who has suffered a heart attack to have a £27,000 Baclofen pump placed in her body after a three-hour operation at the Royal Hospital for Sick Children at Yorkhill, Glasgow, on Thursday morning.
It will allow drugs to be injected directly into her spine, the aim being to reduce the pain and involuntary muscle spasms that she has endured.
Emma, from Dumfries, was placed under observation in the high-dependency unit following the surgery but she is expected to move back to the ward today.
Her mother Robyn Stewart, 32, said: "Emma had her operation and it all went well, so we are so relieved. The surgery is very rare, she will be the first child to have that type of pump fitted in the hospital. We are hoping it will help relax her muscles so she will be able to move around because her muscles are so tight and stiff.
"She is awake and aware of people. She can sometimes move her hands and feet. If a song comes on that she likes then she will move her feet around.
"All I want is for her to talk and tell me how she feels. I was told so many times that she was not going to make it, but she has made so much progress. She is my wee miracle."