From 275a8f9316255e06e2374176329d6f5aed1c7e84 Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Thu, 7 Mar 2019 11:02:47 +0100 Subject: [PATCH] process: make Symbol.toStringTag writable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ecosystem broke by making it non-writable, so this is a good intermediate fix. PR-URL: https://github.com/nodejs/node/pull/26488 Reviewed-By: Michaƫl Zasso Reviewed-By: Yuta Hiroto Reviewed-By: James M Snell --- lib/internal/bootstrap/node.js | 2 +- test/es-module/test-esm-process.mjs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js index aeb330966c42e4..0b0fd7c24acad1 100644 --- a/lib/internal/bootstrap/node.js +++ b/lib/internal/bootstrap/node.js @@ -350,7 +350,7 @@ function setupProcessObject() { EventEmitter.call(process); Object.defineProperty(process, Symbol.toStringTag, { enumerable: false, - writable: false, + writable: true, configurable: false, value: 'process' }); diff --git a/test/es-module/test-esm-process.mjs b/test/es-module/test-esm-process.mjs index 24cf489a988565..ea9b4b4936a313 100644 --- a/test/es-module/test-esm-process.mjs +++ b/test/es-module/test-esm-process.mjs @@ -4,3 +4,4 @@ import assert from 'assert'; import process from 'process'; assert.strictEqual(Object.prototype.toString.call(process), '[object process]'); +assert(Object.getOwnPropertyDescriptor(process, Symbol.toStringTag).writable);