Wireshark-commits: [Wireshark-commits] master 537705a: wslua: prepare for split class/instance (met
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=537705a8b20ee89bf1f713bc0c9959cf21b26900
Submitter: Peter Wu (peter@xxxxxxxxxxxxx)
Changed: branch: master
Repository: wireshark
Commits:
537705a by Peter Wu (peter@xxxxxxxxxxxxx):
wslua: prepare for split class/instance (meta)methods
Previously the metatables for classes were the same for the class and
its instances. This results in issues like calling __gc on the class
table on exit.
Make it possible to declare separate class methods (functions) and
instance methods. Observe that all attributes apply to the instances
only, so make these just available on the instance.
The attribute/methods lookup method (via __index/__newindex) have been
rewritten to use upvalues, removing the technical need for the
properties __getters/__setters/__methods. The "lua globals" test still
checks for these, but it could be removed in the future.
To fix bug 12968, the __gc method is removed from the class method.
Future patches should remove the WSLUA_REGISTER_CLASS,
WSLUA_REGISTER_META and WSLUA_REGISTER_ATTRIBUTES macros completely and
create split class functions/methods (such that __call for an instance
cannot accidentally be invoked on the class).
Removed duplicate "fragmented" property from Pinfo (which triggered an
error) and replaced exit() by g_error() for debugger friendliness.
Remove lua_shiftstring since checkstring always returns non-NULL.
Bug: 12968
Change-Id: I57f8a93d08bb84c79b0e94cf2c82d8402fc16646
Reviewed-on: https://code.wireshark.org/review/18026
Petri-Dish: Peter Wu <peter@xxxxxxxxxxxxx>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@xxxxxxxxxxxxx>
Reviewed-by: Balint Reczey <balint@xxxxxxxxxxxxxxx>
Actions performed:
from 41c6b94 Rename a function to have a name different from a data object's name.
adds 537705a wslua: prepare for split class/instance (meta)methods
Summary of changes:
doc/README.wslua | 50 +++--
epan/wslua/wslua.h | 81 ++++---
epan/wslua/wslua_internals.c | 495 ++++++++++++++++++++++++------------------
epan/wslua/wslua_pinfo.c | 1 -
test/lua/globals_2.2.txt | 25 ---
5 files changed, 362 insertions(+), 290 deletions(-)