Wall street rewards growth over profits so incentives for Salesforce are to keep purchasing businesses which at least break-even (e.g. Heroku) which in turn show growth in revenue but don't necessarily translate into growth in profits.
As long as Salesforce keeps buying these businesses, they can keep showing paper loss forever without actually being in any danger of running out of cash. And while they are doing this, their shareprice might double or triple.
It sounds crazy that it actually works but I'm not the one who is going to argue with markets.