| 152 | } |
| 153 | |
| 154 | int get_instance_value(lua_State* L) |
| 155 | { |
| 156 | lua_getuservalue(L, 1); |
| 157 | lua_pushvalue(L, 2); |
| 158 | lua_rawget(L, -2); |
| 159 | |
| 160 | if (lua_isnil(L, -1) && lua_getmetatable(L, -2)) |
| 161 | { |
| 162 | lua_pushvalue(L, 2); |
| 163 | lua_rawget(L, -2); |
| 164 | } |
| 165 | |
| 166 | if (lua_tocfunction(L, -1) == &property_tag) |
| 167 | { |
| 168 | // this member is a property, extract the "get" function and call it. |
| 169 | lua_getupvalue(L, -1, 1); |
| 170 | lua_pushvalue(L, 1); |
| 171 | lua_call(L, 1, 1); |
| 172 | } |
| 173 | |
| 174 | return 1; |
| 175 | } |
| 176 | |
| 177 | int dispatch_operator(lua_State* L) |
| 178 | { |
nothing calls this directly
no test coverage detected