mirror of
https://github.com/lua/lua
synced 2026-09-26 16:17:11 +03:00
Details
Several details in code (e.g., moving a variable to the most inner scope that encloses its uses), comments, parameter names, extra tests.
This commit is contained in:
parent
9b7987a9d1
commit
6eb53b7526
13 changed files with 52 additions and 45 deletions
6
ldebug.c
6
ldebug.c
|
|
@ -101,7 +101,7 @@ int luaG_getfuncline (const Proto *f, int pc) {
|
|||
}
|
||||
|
||||
|
||||
static int currentline (CallInfo *ci) {
|
||||
static int getcurrentline (CallInfo *ci) {
|
||||
return luaG_getfuncline(ci_func(ci)->p, currentpc(ci));
|
||||
}
|
||||
|
||||
|
|
@ -339,7 +339,7 @@ static int auxgetinfo (lua_State *L, const char *what, lua_Debug *ar,
|
|||
break;
|
||||
}
|
||||
case 'l': {
|
||||
ar->currentline = (ci && isLua(ci)) ? currentline(ci) : -1;
|
||||
ar->currentline = (ci && isLua(ci)) ? getcurrentline(ci) : -1;
|
||||
break;
|
||||
}
|
||||
case 'u': {
|
||||
|
|
@ -775,7 +775,7 @@ l_noret luaG_runerror (lua_State *L, const char *fmt, ...) {
|
|||
msg = luaO_pushvfstring(L, fmt, argp); /* format message */
|
||||
va_end(argp);
|
||||
if (isLua(ci)) /* if Lua function, add source:line information */
|
||||
luaG_addinfo(L, msg, ci_func(ci)->p->source, currentline(ci));
|
||||
luaG_addinfo(L, msg, ci_func(ci)->p->source, getcurrentline(ci));
|
||||
luaG_errormsg(L);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue