still working on porting to lua 5.2

This commit is contained in:
2021-02-28 14:24:59 -05:00
parent 37c3bf8cc1
commit b23728f525
3 changed files with 24 additions and 23 deletions

View File

@@ -156,6 +156,7 @@
extern "C" {
#include "lua.h"
#include "lauxlib.h"
}
#include <string>
@@ -192,7 +193,6 @@ public:
};
extern LuaSpecial LuaRegistry;
extern LuaSpecial LuaGlobals;
class LuaUpvalue : public LuaSlot {
public:
@@ -404,12 +404,12 @@ public:
}
bool equal(LuaSlot v1, LuaSlot v2) const {
return lua_equal(L_, v1, v2);
return lua_compare(L_, v1, v2, LUA_OPEQ);
}
bool equal(LuaSlot v1, const char *name) const {
push_any_value(name);
bool result = lua_equal(L_, v1, -1);
bool result = lua_compare(L_, v1, -1, LUA_OPEQ);
lua_pop(L_, 1);
return result;
}