valenok/mongoose — pull request #127 by abadc0de (2013-03-12 05:42:31+00:00)
Title: Use relative stack index for error handler in lsp()

Make mg.onerror work with mg.include, and clean up redundant code.

It turns out there can be things on the call stack here after all, so absolute indices are no good. The error handler was never firing for runtime errors on included pages.

Adding lua_settop(L, 0) at the top of the block would "fix" it too (the "dead code" I was paranoid about), but it's probably better to leave the stack alone here.