From ce9bba3cb5409844f8f3d7dcc235a9ea30cad090 Mon Sep 17 00:00:00 2001 From: Josh Haberman Date: Fri, 20 Dec 2013 17:40:40 -0800 Subject: Sync from Google-internal development. --- bindings/lua/lunitx/atexit.lua | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 bindings/lua/lunitx/atexit.lua (limited to 'bindings/lua/lunitx/atexit.lua') diff --git a/bindings/lua/lunitx/atexit.lua b/bindings/lua/lunitx/atexit.lua deleted file mode 100644 index c3cdddc..0000000 --- a/bindings/lua/lunitx/atexit.lua +++ /dev/null @@ -1,32 +0,0 @@ - -local actions = {} - -local atexit - -if _VERSION >= 'Lua 5.2' then - - atexit = function (fn) - actions[#actions+1] = setmetatable({}, { __gc = fn }) - end - -else - - local newproxy = newproxy - local debug = debug - local assert = assert - local setmetatable = setmetatable - - local function gc(fn) - local p = assert(newproxy()) - assert(debug.setmetatable(p, { __gc = fn })) - return p - end - - atexit = function (fn) - actions[#actions+1] = gc(fn) - end - -end - -return atexit - -- cgit v1.2.3