From 842ff44288aaa44f7ac1e5373cb19a662dfa5929 Mon Sep 17 00:00:00 2001 From: Kayla Altepeter Date: Fri, 12 Oct 2018 09:49:09 -0700 Subject: [PATCH] test: rename process.argv[0] to process.execPath, rename ex to err PR-URL: https://github.com/nodejs/node/pull/23488 Reviewed-By: Colin Ihrig Reviewed-By: Bryan English Reviewed-By: Gireesh Punathil Reviewed-By: James M Snell Reviewed-By: Trivikram Kamat Reviewed-By: Ruben Bridgewater --- test/parallel/test-common.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/parallel/test-common.js b/test/parallel/test-common.js index 51e0302868cbe6..a133204437facb 100644 --- a/test/parallel/test-common.js +++ b/test/parallel/test-common.js @@ -29,8 +29,8 @@ const { execFile } = require('child_process'); // test for leaked global detection { const p = fixtures.path('leakedGlobal.js'); - execFile(process.argv[0], [p], common.mustCall((ex, stdout, stderr) => { - assert.notStrictEqual(ex.code, 0); + execFile(process.execPath, [p], common.mustCall((err, stdout, stderr) => { + assert.notStrictEqual(err.code, 0); assert.ok(/\bAssertionError\b.*\bUnexpected global\b.*\bgc\b/.test(stderr)); })); } @@ -85,8 +85,8 @@ const failFixtures = [ ]; for (const p of failFixtures) { const [file, expected] = p; - execFile(process.argv[0], [file], common.mustCall((ex, stdout, stderr) => { - assert.ok(ex); + execFile(process.execPath, [file], common.mustCall((err, stdout, stderr) => { + assert.ok(err); assert.strictEqual(stderr, ''); const firstLine = stdout.split('\n').shift(); assert.strictEqual(firstLine, expected);