From 45b59e58d12f573524b7ef0beb4b3da69028c713 Mon Sep 17 00:00:00 2001 From: Deokjin Kim Date: Mon, 10 Jun 2024 23:56:14 +0900 Subject: [PATCH] lib: fix naming convention of `Symbol` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `node.js` prefix is used for global symbol(`Symbol.for`). So remove `node.js` prefix from `Symbol` usage. Refs: https://github.com/nodejs/node/blob/main/doc/contributing/using-symbols.md#symbolforstring PR-URL: https://github.com/nodejs/node/pull/53387 Reviewed-By: Matteo Collina Reviewed-By: Luigi Pinca Reviewed-By: Vinícius Lourenço Claro Cardoso Reviewed-By: Marco Ippolito --- lib/internal/event_target.js | 2 +- lib/internal/events/symbols.js | 2 +- lib/internal/http2/util.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/internal/event_target.js b/lib/internal/event_target.js index 1c7fd9dedb4878..ecdc1bbba054a3 100644 --- a/lib/internal/event_target.js +++ b/lib/internal/event_target.js @@ -65,7 +65,7 @@ const kWeakHandler = Symbol('kWeak'); const kResistStopPropagation = Symbol('kResistStopPropagation'); const kHybridDispatch = SymbolFor('nodejs.internal.kHybridDispatch'); -const kRemoveWeakListenerHelper = Symbol('nodejs.internal.removeWeakListenerHelper'); +const kRemoveWeakListenerHelper = Symbol('kRemoveWeakListenerHelper'); const kCreateEvent = Symbol('kCreateEvent'); const kNewListener = Symbol('kNewListener'); const kRemoveListener = Symbol('kRemoveListener'); diff --git a/lib/internal/events/symbols.js b/lib/internal/events/symbols.js index b1b89ddb8f0a4d..fb0da6e96f119f 100644 --- a/lib/internal/events/symbols.js +++ b/lib/internal/events/symbols.js @@ -4,7 +4,7 @@ const { Symbol, } = primordials; -const kFirstEventParam = Symbol('nodejs.kFirstEventParam'); +const kFirstEventParam = Symbol('kFirstEventParam'); module.exports = { kFirstEventParam, diff --git a/lib/internal/http2/util.js b/lib/internal/http2/util.js index 4b0cc941a5e078..46e0218ac64f2e 100644 --- a/lib/internal/http2/util.js +++ b/lib/internal/http2/util.js @@ -34,7 +34,7 @@ const { kIsNodeError, } = require('internal/errors'); -const kSensitiveHeaders = Symbol('nodejs.http2.sensitiveHeaders'); +const kSensitiveHeaders = Symbol('sensitiveHeaders'); const kSocket = Symbol('socket'); const kProxySocket = Symbol('proxySocket'); const kRequest = Symbol('request');