mirror of
https://github.com/lua/lua
synced 2026-09-29 04:35:58 +03:00
new interface for 'tonumber'
This commit is contained in:
parent
d4e6b75098
commit
4abe99dc34
4 changed files with 34 additions and 39 deletions
6
ldebug.c
6
ldebug.c
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
** $Id: ldebug.c,v 2.91 2013/04/25 15:59:42 roberto Exp roberto $
|
||||
** $Id: ldebug.c,v 2.92 2013/04/26 13:07:53 roberto Exp roberto $
|
||||
** Debug Interface
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
|
|
@ -525,8 +525,8 @@ l_noret luaG_concaterror (lua_State *L, StkId p1, StkId p2) {
|
|||
|
||||
|
||||
l_noret luaG_aritherror (lua_State *L, const TValue *p1, const TValue *p2) {
|
||||
TValue temp;
|
||||
if (luaV_tonumber(p1, &temp) == NULL)
|
||||
lua_Number temp;
|
||||
if (!tonumber(p1, &temp))
|
||||
p2 = p1; /* first operand is wrong */
|
||||
luaG_typeerror(L, p2, "perform arithmetic on");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue