Debug pane: Show error message in log

This commit is contained in:
fkloft 2013-10-19 14:06:59 +02:00
parent 60e6552ca2
commit de621000ce

View File

@ -680,7 +680,18 @@ window.chat.postMsg = function() {
var msg = $.trim($('#chatinput input').val());
if(!msg || msg === '') return;
if(c === 'debug') return new Function (msg)();
if(c === 'debug') {
var result;
try {
result = eval(msg);
} catch(e) {
if(e.stack) console.error(e.stack);
throw e; // to trigger native error message
}
if(result !== undefined)
console.log(result.toString());
return result;
}
var publik = c === 'public';
var latlng = map.getCenter();