Debug pane: Show error message in log
This commit is contained in:
parent
60e6552ca2
commit
de621000ce
13
code/chat.js
13
code/chat.js
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user