daily pastebin goal
68%
SHARE
TWEET

Untitled

a guest Jul 11th, 2018 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. lua_pushnil(state);
  2. while (lua_next(state, LUA_GLOBALSINDEX) != 0)
  3. {
  4.   dump_stack(state, "start...");
  5.   if (lua_type(state, -2) == LUA_TSTRING)
  6.   {
  7.     const char* k = lua_tostring(state, -2);
  8.     printf("unloading %s\n", k);
  9.     dump_stack(state, "after get key...")
  10.     SharedValue newValue = LuaUtils::ToKrollValue(state);  // pops value and converts
  11.     dump_stack(state, "after get value...");
  12.     SharedValue existingValue = window_global->Get(k);
  13.     if (!newValue->Equals(existingValue))
  14.     {
  15.       window_global->Set(k, newValue);
  16.     }
  17.   }
  18.   else
  19.   {
  20.     lua_pop(state, 1);
  21.   }
  22.   dump_stack(state, "end");
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top