The only time I have seen this is with startups --- where they are cash strapped so engineers building the new product are given *equity* instead of wages.
Equity can be created simply by issuing stock --- which for a startup with negative cash flow is basically worthless at the time.
This is highly risky for the employee. If the product/company is wildly successful, early employees can get rich. But most startups fail --- so more often, they're left with nothing to show for their work.