WoW 3.3.5 Lua 5.1 runtime has table.setn as an error stub ("'setn' is obsolete")
and table.getn missing/erroring. The embedded Ace2 libs (AceLibrary, AceOO, AceEvent,
AceConsole, AceDebug, AceDB, Tablet-2.0) all assign table_setn = table.setn at module
scope when GetBuildInfo() does not start with "2." — causing AceOO-2.0 to crash at
line 546 before any library can register, then cascading to AceConsole/FuBarPlugin.
Add Lua50Compat.lua as the first TOC entry to unconditionally overwrite table.setn
(no-op) and table.getn (returns #t) before any lib loads. Also shims
table.foreach/foreachi in case future libs need them. Verified with LuaJIT 5.1:
AceLibrary + AceOO load cleanly; all other libs stop only at WoW-API boundaries
(not at obsolete-call errors).