diff options
Diffstat (limited to 'deps')
-rw-r--r-- | deps/lua/src/lapi.c | 8 | ||||
-rw-r--r-- | deps/lua/src/lua.h | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/deps/lua/src/lapi.c b/deps/lua/src/lapi.c index 1a9455629..e8ef41ea2 100644 --- a/deps/lua/src/lapi.c +++ b/deps/lua/src/lapi.c @@ -1099,3 +1099,11 @@ LUA_API void lua_enablereadonlytable (lua_State *L, int objindex, int enabled) { t->readonly = enabled; } +LUA_API int lua_isreadonlytable (lua_State *L, int objindex) { + const TValue* o = index2adr(L, objindex); + api_check(L, ttistable(o)); + Table* t = hvalue(o); + api_check(L, t != hvalue(registry(L))); + return t->readonly; +} + diff --git a/deps/lua/src/lua.h b/deps/lua/src/lua.h index e478d14c0..280ef2382 100644 --- a/deps/lua/src/lua.h +++ b/deps/lua/src/lua.h @@ -359,6 +359,7 @@ struct lua_Debug { }; LUA_API void lua_enablereadonlytable (lua_State *L, int index, int enabled); +LUA_API int lua_isreadonlytable (lua_State *L, int index); /* }====================================================================== */ |