mirror of
https://github.com/nodejs/node.git
synced 2026-11-30 11:55:44 -05:00
lib: replace charCodeAt with fixed Unicode
PR-URL: https://github.com/nodejs/node/pull/32758 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com>
This commit is contained in:
1 parent
a2daa7ba24
commit
fdd3f3d63b
3 files changed
+20
-6
No files matched your search
@@ -40,13 +40,19 @@ const {
|
||||
const {
|
||||
isTypedArray, isSet, isMap, isSetIterator, isMapIterator,
|
||||
} = require('internal/util/types');
|
||||
const {
|
||||
CHAR_LOWERCASE_B,
|
||||
CHAR_LOWERCASE_E,
|
||||
CHAR_LOWERCASE_N,
|
||||
CHAR_UPPERCASE_C,
|
||||
} = require('internal/constants');
|
||||
const kCounts = Symbol('counts');
|
||||
|
||||
const kTraceConsoleCategory = 'node,node.console';
|
||||
const kTraceCount = 'C'.charCodeAt(0);
|
||||
const kTraceBegin = 'b'.charCodeAt(0);
|
||||
const kTraceEnd = 'e'.charCodeAt(0);
|
||||
const kTraceInstant = 'n'.charCodeAt(0);
|
||||
const kTraceCount = CHAR_UPPERCASE_C;
|
||||
const kTraceBegin = CHAR_LOWERCASE_B;
|
||||
const kTraceEnd = CHAR_LOWERCASE_E;
|
||||
const kTraceInstant = CHAR_LOWERCASE_N;
|
||||
|
||||
const kMaxGroupIndentation = 1000;
|
||||
|
||||
|
||||
@@ -8,6 +8,10 @@ module.exports = {
|
||||
CHAR_LOWERCASE_A: 97, /* a */
|
||||
CHAR_UPPERCASE_Z: 90, /* Z */
|
||||
CHAR_LOWERCASE_Z: 122, /* z */
|
||||
CHAR_UPPERCASE_C: 67, /* C */
|
||||
CHAR_LOWERCASE_B: 98, /* b */
|
||||
CHAR_LOWERCASE_E: 101, /* e */
|
||||
CHAR_LOWERCASE_N: 110, /* n */
|
||||
|
||||
// Non-alphabetic chars.
|
||||
CHAR_DOT: 46, /* . */
|
||||
|
||||
@@ -10,12 +10,16 @@ const {
|
||||
const { trace } = internalBinding('trace_events');
|
||||
const async_wrap = internalBinding('async_wrap');
|
||||
const async_hooks = require('async_hooks');
|
||||
const {
|
||||
CHAR_LOWERCASE_B,
|
||||
CHAR_LOWERCASE_E,
|
||||
} = require('internal/constants');
|
||||
|
||||
// Use small letters such that chrome://tracing groups by the name.
|
||||
// The behavior is not only useful but the same as the events emitted using
|
||||
// the specific C++ macros.
|
||||
const kBeforeEvent = 'b'.charCodeAt(0);
|
||||
const kEndEvent = 'e'.charCodeAt(0);
|
||||
const kBeforeEvent = CHAR_LOWERCASE_B;
|
||||
const kEndEvent = CHAR_LOWERCASE_E;
|
||||
const kTraceEventCategory = 'node,node.async_hooks';
|
||||
|
||||
const kEnabled = Symbol('enabled');
|
||||
|
||||
Reference in new issue
Block a user