From aada59b068654af6f0d6ee0da95ebf3bb0c86849 Mon Sep 17 00:00:00 2001 From: Oliver Eyton-Williams Date: Fri, 27 Sep 2019 13:54:29 +0200 Subject: [PATCH] fix: make fcc console log undefined --- client/src/client/workers/test-evaluator.js | 2 +- client/src/templates/Challenges/utils/frame.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/client/workers/test-evaluator.js b/client/src/client/workers/test-evaluator.js index df0b6ea1a8..30584bd40e 100644 --- a/client/src/client/workers/test-evaluator.js +++ b/client/src/client/workers/test-evaluator.js @@ -18,7 +18,7 @@ const __utils = (() => { const oldLog = self.console.log.bind(self.console); self.console.log = function proxyConsole(...args) { - logs.push(args.map(arg => JSON.stringify(arg)).join(' ')); + logs.push(args.map(arg => '' + JSON.stringify(arg)).join(' ')); if (logs.join('\n').length > MAX_LOGS_SIZE) { flushLogs(); } diff --git a/client/src/templates/Challenges/utils/frame.js b/client/src/templates/Challenges/utils/frame.js index c022071657..da021b4f82 100644 --- a/client/src/templates/Challenges/utils/frame.js +++ b/client/src/templates/Challenges/utils/frame.js @@ -83,7 +83,7 @@ const mountFrame = document => ({ element, ...rest }) => { const buildProxyConsole = proxyLogger => ctx => { const oldLog = ctx.window.console.log.bind(ctx.window.console); ctx.window.console.log = function proxyConsole(...args) { - proxyLogger(args.map(arg => JSON.stringify(arg)).join(' ')); + proxyLogger(args.map(arg => '' + JSON.stringify(arg)).join(' ')); return oldLog(...args); }; return ctx;