Bug 998799 - alameda.js depends toString()-ing functions

v1.3t manual merge of master commit 2abac39da5cf2c600df1a8ff25bf0d69420043b8