Revert change that removed default traceback in debug builds.

This commit is contained in:
James Roseborough
2015-04-23 03:25:30 +00:00
parent cdc33ab5b6
commit 4c3d0f9cdd
2 changed files with 3 additions and 2 deletions

View File

@@ -1014,7 +1014,6 @@ and at <a href="http://luaj.sourceforge.net/api/2.0/index.html">http://luaj.sour
<li>Make shared string metatable an actual metatable.</li> <li>Make shared string metatable an actual metatable.</li>
<li>Add sample code that illustrates techniques in creating sandboxed environments.</li> <li>Add sample code that illustrates techniques in creating sandboxed environments.</li>
<li>Add convenience methods to Global to load string scripts with custom environment.</li> <li>Add convenience methods to Global to load string scripts with custom environment.</li>
<li>Turn off default traceback. Use xpcall() with debug.traceback instead.</li>
<li>Move online docs to <a href="http://luaj.org/luaj/3.0/api/index.html">http://luaj.org/luaj/3.0/api/</a></li> <li>Move online docs to <a href="http://luaj.org/luaj/3.0/api/index.html">http://luaj.org/luaj/3.0/api/</a></li>
</ul></td></tr> </ul></td></tr>

View File

@@ -522,7 +522,9 @@ public class LuaClosure extends LuaFunction {
if (globals == null ) return msg; if (globals == null ) return msg;
final LuaThread r = globals.running; final LuaThread r = globals.running;
if (r.errorfunc == null) if (r.errorfunc == null)
return msg; return globals.debuglib != null?
msg + "\n" + globals.debuglib.traceback(level):
msg;
final LuaValue e = r.errorfunc; final LuaValue e = r.errorfunc;
r.errorfunc = null; r.errorfunc = null;
try { try {