mpx/lua-cjson — pull request #14 by dustyleary (2013-10-22 23:45:29+00:00)
Title: invoke getmetatable(val).__tojson() if present

This allows you to provide custom serialization.
It mimics the same feature in dkjson.