We're checking for a valid metaMETHOD, not a valid metaFIELD

This commit is contained in:
Reuben Thomas
2014-08-05 17:27:55 +01:00
parent 55ba8f6cbd
commit 1c83c2328a
+1 -1
View File
@@ -139,7 +139,7 @@ static void check_subject (lua_State *L, int pos, TArgExec *argE)
argE->textlen = lua_objlen (L, pos);
else {
if (!luaL_getmetafield (L, pos, "__len") || lua_type (L, -1) != LUA_TFUNCTION)
luaL_argerror (L, pos, "the subject has no valid __len metafield");
luaL_argerror (L, pos, "the subject has no valid __len metamethod");
lua_pushvalue (L, pos);
lua_call (L, 1, 1);
type = lua_type (L, -1);