Permalink
Browse files

Make /eval output whatever it did

  • Loading branch information...
RussellLVP committed Oct 19, 2016
1 parent 0b41754 commit 63765edf1017463f55f54db6cc3c6224f51c83e5
Showing with 10 additions and 1 deletion.
  1. +10 −1 javascript/features/debug/debug.js
@@ -135,7 +135,16 @@ class Debug extends Feature {
// Evaluates the |command| on behalf of |player|.
eval(player, command) {
console.log('[JavaScript] Evaluating: ' + command);
eval(command);
const output = '' + JSON.stringify(eval(command), null, ' ');
const lines = output.split('\n');
for (let i = 0; i < Math.min(8, lines.length); ++i) {
player.sendMessage('>> ' + lines[i]);
}
if (lines.length > 8)
player.sendMessage('>> Omitted ' + (lines.length - 8) + ' lines.');
}
// Lists the players who currently have minimized their game.

0 comments on commit 63765ed

Please sign in to comment.