View Single Post
04-22-22, 10:11 AM   #4
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,327
As you've pointed out, the debug built-in library was disabled. Only a few functions remain from it, namely getfenv(), setfenv(), and debugstack() (formerly debug.traceback()).

There's no other way to externally query the number of parameters, especially since string.dump() was removed too. This would output the function's compiled code as a string (didn't work on C-defined functions).

Honestly, all argument validation should be done on the called function, not the caller. You can still use assert() and error() to throw custom errors and pcall()/xpcall() to catch them in your slash handler or do status/error returns and catch issues that way.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote