From 60c71f35eede066e0663755344724df923b13c63 Mon Sep 17 00:00:00 2001 From: madflow Date: Fri, 4 Feb 2022 20:13:01 +0100 Subject: [PATCH] process: fix named report export PR-URL: https://github.com/nodejs/node/pull/41861 Fixes: https://github.com/nodejs/node/issues/41774 Reviewed-By: Benjamin Gruenbaum Reviewed-By: James M Snell --- lib/internal/bootstrap/pre_execution.js | 2 +- test/es-module/test-esm-process.mjs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js index 33a594d35fcbb0..98428f02b43817 100644 --- a/lib/internal/bootstrap/pre_execution.js +++ b/lib/internal/bootstrap/pre_execution.js @@ -253,7 +253,7 @@ function setupStacktracePrinterOnSigint() { function initializeReport() { const { report } = require('internal/process/report'); ObjectDefineProperty(process, 'report', { - enumerable: false, + enumerable: true, configurable: true, get() { return report; diff --git a/test/es-module/test-esm-process.mjs b/test/es-module/test-esm-process.mjs index 8fa006a304ed2f..f88eba849df715 100644 --- a/test/es-module/test-esm-process.mjs +++ b/test/es-module/test-esm-process.mjs @@ -1,6 +1,7 @@ import '../common/index.mjs'; import assert from 'assert'; -import process from 'process'; +import process, { report } from 'process'; assert.strictEqual(Object.prototype.toString.call(process), '[object process]'); assert(Object.getOwnPropertyDescriptor(process, Symbol.toStringTag).writable); +assert(report);