Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
0.10.0
-
None
-
None
Description
The Lua library defines or clobbers global variables, due to its lack of module encapsulation, making it an intrusive library that is atypically difficult to get working in my application context, and unnecessarily lowering its likelihood of working in other environments with diverse dependencies.
Ideally callers would access resources like this:
local TCompactProtocol = require 'Thrift'.TCompactProtocol
And the Thrift library would publish them like this:
-- Thrift.lua local M = {} M.ttype = function(obj) ... M.terror = function(e) ... M.version = 0.10 M.TType = ... M.__TObject = ... M.TProtocolBase = ... M.TCompactProtocol = M.__TObject.new(M.TProtocolBase, {... return M
The source codes should survive a check like this:
$ luacheck --std max+busted --codes src/lua test/lua --no-self --ignore 213 311 611 631
Globals:
- __TClient
- __tobj_index
- __TObject
- __TProcessor
- base64_encode
- ch
- client
- CompactTypeToTType
- EscapeCharVals
- JSONCharTable
- JSONNode
- libluabitwise
- libluabpack
- liblualongnumber
- StringToTType
- TBinaryProtocol
- TBinaryProtocolFactory
- TBufferedTransport
- TCompactProtocol
- TCompactType
- terror
- TException
- TFramedTransport
- TFramedTransportFactory
- thrift_print_r
- THttpTransport
- THttpTransportFactory
- TJSONProtocol
- TMemoryBuffer
- TMessageType
- TProtocolBase
- TProtocolException
- TServer
- TSimpleServer
- ttable_size
- TTransportBase
- TTransportException
- TTransportFactoryBase
- ttype
- TType
- TTypeToCompactType
- TTypeToString
- version