stackToJSON was a misnomer