diff --git a/services/spelling/app/js/ASpellWorker.js b/services/spelling/app/js/ASpellWorker.js index c4ead15083..834917b755 100644 --- a/services/spelling/app/js/ASpellWorker.js +++ b/services/spelling/app/js/ASpellWorker.js @@ -90,7 +90,10 @@ class ASpellWorker { ) this.callback = null } else { - logger.warn({ error: err, ...errInfo }, 'aspell worker error') + logger.warn( + Object.assign({ error: err }, errInfo), + 'aspell worker error' + ) } }) this.pipe.stdin.on('error', err => { @@ -119,10 +122,7 @@ class ASpellWorker { this.callback = null } else { logger.warn( - { - error: err, - ...errInfo - }, + Object.assign({ error: err }, errInfo), 'aspell worker error on stdin' ) } @@ -134,7 +134,7 @@ class ASpellWorker { this.pipe.stdout.on('data', data => { // We receive the language code from Aspell as the end of data marker in // the data. The input is a utf8 encoded string. - let oldPos = output.length + const oldPos = output.length output = output + data // The end marker may cross the end of a chunk, so we optimise the search // using the regex lastIndex property.