Commit 2032d4956229d9ebe277fdae26d7aed149f4aaf0
1 parent
ad94417d
fuckit
git-svn-id: http://svn.net-core.org/repos/t-engine4@1995 51575b47-30f0-44d4-a5cc-537603b46e54
Showing
3 changed files
with
20 additions
and
1 deletions
... | ... | @@ -138,9 +138,24 @@ static bool basic_serialize(lua_State *L, serial_type *s, int type, int idx) |
138 | 138 | dump_string(s, str, len); |
139 | 139 | writeZipFixed(s, "\"", 1); |
140 | 140 | } else if (type == LUA_TFUNCTION) { |
141 | +/* | |
141 | 142 | writeZipFixed(s, "loadstring(\"", 12); |
142 | 143 | lua_dump(L, dump_function, s); |
143 | 144 | writeZipFixed(s, "\")", 2); |
145 | +*/ | |
146 | + lua_getglobal(L, "__dump_fct"); | |
147 | + lua_pushvalue(L, idx-1); | |
148 | + lua_call(L, 1, 1); | |
149 | + | |
150 | + size_t len; | |
151 | + const char *str = lua_tolstring(L, -1, &len); | |
152 | + | |
153 | + writeZipFixed(s, "loadstring(", 11); | |
154 | + writeZipFixed(s, str, len); | |
155 | + writeZipFixed(s, ")", 1); | |
156 | + | |
157 | + lua_pop(L, 1); | |
158 | + | |
144 | 159 | } else if (type == LUA_TTABLE) { |
145 | 160 | lua_pushstring(L, "__CLASSNAME"); |
146 | 161 | lua_rawget(L, idx - 1); | ... | ... |
-
Please register or login to post a comment