diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-05-02 14:12:27 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-05-02 14:12:27 -0300 |
commit | 85dcb411a8454de0bc1c2c60a24af1588e436c23 (patch) | |
tree | 169fc4cefe7ba02a46944a172660aff208b3e42e /lbaselib.c | |
parent | 3c6a383d6239629fd8858e0d59bcdab25138bcc1 (diff) | |
download | lua-85dcb411a8454de0bc1c2c60a24af1588e436c23.tar.gz lua-85dcb411a8454de0bc1c2c60a24af1588e436c23.tar.bz2 lua-85dcb411a8454de0bc1c2c60a24af1588e436c23.zip |
all textual errors go through `luaL_verror'
Diffstat (limited to 'lbaselib.c')
-rw-r--r-- | lbaselib.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lbaselib.c,v 1.69 2002/04/22 14:40:23 roberto Exp roberto $ | 2 | ** $Id: lbaselib.c,v 1.70 2002/05/01 20:40:42 roberto Exp roberto $ |
3 | ** Basic library | 3 | ** Basic library |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -72,7 +72,7 @@ static int luaB_print (lua_State *L) { | |||
72 | lua_rawcall(L, 1, 1); | 72 | lua_rawcall(L, 1, 1); |
73 | s = lua_tostring(L, -1); /* get result */ | 73 | s = lua_tostring(L, -1); /* get result */ |
74 | if (s == NULL) | 74 | if (s == NULL) |
75 | lua_error(L, "`tostring' must return a string to `print'"); | 75 | luaL_verror(L, "`tostring' must return a string to `print'"); |
76 | if (i>1) fputs("\t", stdout); | 76 | if (i>1) fputs("\t", stdout); |
77 | fputs(s, stdout); | 77 | fputs(s, stdout); |
78 | lua_pop(L, 1); /* pop result */ | 78 | lua_pop(L, 1); /* pop result */ |
@@ -372,7 +372,7 @@ static int luaB_require (lua_State *L) { | |||
372 | lua_pushvalue(L, 1); | 372 | lua_pushvalue(L, 1); |
373 | lua_setglobal(L, "_REQUIREDNAME"); | 373 | lua_setglobal(L, "_REQUIREDNAME"); |
374 | lua_getglobal(L, REQTAB); | 374 | lua_getglobal(L, REQTAB); |
375 | if (!lua_istable(L, 2)) lua_error(L, REQTAB " is not a table"); | 375 | if (!lua_istable(L, 2)) luaL_verror(L, REQTAB " is not a table"); |
376 | path = getpath(L); | 376 | path = getpath(L); |
377 | lua_pushvalue(L, 1); /* check package's name in book-keeping table */ | 377 | lua_pushvalue(L, 1); /* check package's name in book-keeping table */ |
378 | lua_gettable(L, 2); | 378 | lua_gettable(L, 2); |
@@ -399,7 +399,7 @@ static int luaB_require (lua_State *L) { | |||
399 | lua_tostring(L, 1), lua_tostring(L, 3)); | 399 | lua_tostring(L, 1), lua_tostring(L, 3)); |
400 | } | 400 | } |
401 | default: { | 401 | default: { |
402 | lua_error(L, "error loading package"); | 402 | luaL_verror(L, "error loading package"); |
403 | return 0; /* to avoid warnings */ | 403 | return 0; /* to avoid warnings */ |
404 | } | 404 | } |
405 | } | 405 | } |
@@ -466,7 +466,7 @@ static int luaB_coroutine (lua_State *L) { | |||
466 | luaL_arg_check(L, lua_isfunction(L, 1) && !lua_iscfunction(L, 1), 1, | 466 | luaL_arg_check(L, lua_isfunction(L, 1) && !lua_iscfunction(L, 1), 1, |
467 | "Lua function expected"); | 467 | "Lua function expected"); |
468 | NL = lua_newthread(L); | 468 | NL = lua_newthread(L); |
469 | if (NL == NULL) lua_error(L, "unable to create new thread"); | 469 | if (NL == NULL) luaL_verror(L, "unable to create new thread"); |
470 | /* move function and arguments from L to NL */ | 470 | /* move function and arguments from L to NL */ |
471 | for (i=0; i<n; i++) { | 471 | for (i=0; i<n; i++) { |
472 | ref = lua_ref(L, 1); | 472 | ref = lua_ref(L, 1); |