diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2003-05-13 16:22:19 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2003-05-13 16:22:19 -0300 |
commit | c7677471918fa55095f4993484eb5805091364fd (patch) | |
tree | e916682119d3aebe6a8fae9ac4ab092b5f28f98c /ltests.c | |
parent | f966404ed636c1e61b4ab5ee5e7715739cc4ab49 (diff) | |
download | lua-c7677471918fa55095f4993484eb5805091364fd.tar.gz lua-c7677471918fa55095f4993484eb5805091364fd.tar.bz2 lua-c7677471918fa55095f4993484eb5805091364fd.zip |
new (internal) macros for error handling
Diffstat (limited to 'ltests.c')
-rw-r--r-- | ltests.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltests.c,v 1.158 2003/04/07 14:35:00 roberto Exp roberto $ | 2 | ** $Id: ltests.c,v 1.159 2003/04/28 19:58:06 roberto Exp roberto $ |
3 | ** Internal Module for Debugging of the Lua Implementation | 3 | ** Internal Module for Debugging of the Lua Implementation |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -733,6 +733,15 @@ static int testC (lua_State *L) { | |||
733 | luaL_setn(L, i, n); | 733 | luaL_setn(L, i, n); |
734 | lua_pop(L, 1); | 734 | lua_pop(L, 1); |
735 | } | 735 | } |
736 | else if EQ("throw") { | ||
737 | #ifdef _cplusplus | ||
738 | static struct X { int x; } x; | ||
739 | throw x; | ||
740 | #else | ||
741 | luaL_error(L, "C++"); | ||
742 | #endif | ||
743 | break; | ||
744 | } | ||
736 | else luaL_error(L, "unknown instruction %s", buff); | 745 | else luaL_error(L, "unknown instruction %s", buff); |
737 | } | 746 | } |
738 | return 0; | 747 | return 0; |