From 8f7326c369258a635d5351fd0274427e09f4181c Mon Sep 17 00:00:00 2001 From: Amanpreet Date: Sat, 17 Nov 2018 18:08:08 +0530 Subject: [PATCH] test: replace anonymous closure functions with arrow function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/24417 Reviewed-By: Michaƫl Zasso Reviewed-By: Colin Ihrig Reviewed-By: Gireesh Punathil Reviewed-By: Trivikram Kamat Reviewed-By: James M Snell --- test/parallel/test-error-reporting.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/parallel/test-error-reporting.js b/test/parallel/test-error-reporting.js index b9d78b181aef47..f56f1e4bdca67d 100644 --- a/test/parallel/test-error-reporting.js +++ b/test/parallel/test-error-reporting.js @@ -27,7 +27,7 @@ const fixtures = require('../common/fixtures'); function errExec(script, callback) { const cmd = `"${process.argv[0]}" "${fixtures.path(script)}"`; - return exec(cmd, function(err, stdout, stderr) { + return exec(cmd, (err, stdout, stderr) => { // There was some error assert.ok(err); @@ -43,39 +43,39 @@ const syntaxErrorMessage = /\bSyntaxError\b/; // Simple throw error -errExec('throws_error.js', common.mustCall(function(err, stdout, stderr) { +errExec('throws_error.js', common.mustCall((err, stdout, stderr) => { assert.ok(/blah/.test(stderr)); })); // Trying to JSON.parse(undefined) -errExec('throws_error2.js', common.mustCall(function(err, stdout, stderr) { +errExec('throws_error2.js', common.mustCall((err, stdout, stderr) => { assert.ok(syntaxErrorMessage.test(stderr)); })); // Trying to JSON.parse(undefined) in nextTick -errExec('throws_error3.js', common.mustCall(function(err, stdout, stderr) { +errExec('throws_error3.js', common.mustCall((err, stdout, stderr) => { assert.ok(syntaxErrorMessage.test(stderr)); })); // throw ILLEGAL error -errExec('throws_error4.js', common.mustCall(function(err, stdout, stderr) { +errExec('throws_error4.js', common.mustCall((err, stdout, stderr) => { assert.ok(syntaxErrorMessage.test(stderr)); })); // Specific long exception line doesn't result in stack overflow -errExec('throws_error5.js', common.mustCall(function(err, stdout, stderr) { +errExec('throws_error5.js', common.mustCall((err, stdout, stderr) => { assert.ok(syntaxErrorMessage.test(stderr)); })); // Long exception line with length > errorBuffer doesn't result in assertion -errExec('throws_error6.js', common.mustCall(function(err, stdout, stderr) { +errExec('throws_error6.js', common.mustCall((err, stdout, stderr) => { assert.ok(syntaxErrorMessage.test(stderr)); })); // Object that throws in toString() doesn't print garbage -errExec('throws_error7.js', common.mustCall(function(err, stdout, stderr) { +errExec('throws_error7.js', common.mustCall((err, stdout, stderr) => { assert.ok(/