Why were callbacks done by variable name anyway? Functions are first class values in Lua; you should be able to pass a function, not a string, and have that function called. The scope of the variable where that function value is stored in the users code should be irrelevant. You should be able to use anonymous functions if you want, too:
CCTouchDelegate:registerScriptTouchHandler(cocos2d.CCTOUCHBEGAN, function(e) end)
I can’t see YuLei Liao’s code (link is busted), but I imagine he just added support for storing function references.
If I add this to my copy of coco2d-x, how would I go about submitting it back to the repository? I’ve never contributed to an open source project before, but I know Lua quite well and will probably be working on this binding for my own use anyway.