setjmp/longjmp works in emscripten, it does prevent some optimizations in functions where it is called though. But luckily it doesn't seem like it is called in anything performance-sensitive in the benchmarks I've tested.
Not sure if this is related, but you often have to declare local variables volatile when using setjmp/longjmp because they do not preserve registers. It's one case where unoptimized C code will run fine, then -O will push variables into registers and break it.
I wonder how difficult it would be to convert Lua to C++ with exceptions.
This isn't an issue for Lua, because so much effort has gone into making it extremely portable. Regardless, a port to C++ would be possible, though I'd (without thinking about it much) guess it would take a performance hit due to the increased code size from to the EH tables causing icache misses.