From a63e737bd12e466937223c848387d0b704f02e31 Mon Sep 17 00:00:00 2001 From: William Ahern Date: Fri, 24 Jun 2016 19:00:25 -0700 Subject: refactor and add ashb's regression test for #53 --- src/openssl.auxlib.lua | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/openssl.auxlib.lua (limited to 'src/openssl.auxlib.lua') diff --git a/src/openssl.auxlib.lua b/src/openssl.auxlib.lua new file mode 100644 index 0000000..4f00c25 --- /dev/null +++ b/src/openssl.auxlib.lua @@ -0,0 +1,21 @@ +local auxlib = {} + +if _VERSION == "Lua 5.1" then + local _pairs = pairs + + function auxlib.pairs(t) + if type(t) == "userdata" then + local mt = getmetatable(t) + + if mt and mt.__pairs then + return mt.__pairs(t) + else + return _pairs(t) + end + end + end +else + auxlib.pairs = pairs +end + +return auxlib -- cgit v1.2.3-59-g8ed1b