Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
lib: replace charCodeAt with fixed Unicode
  • Loading branch information
rickyes committed Apr 10, 2020
commit b04ba6df2372160fe5b9a14e0a1a9a166577ed61
12 changes: 8 additions & 4 deletions lib/internal/console/constructor.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,14 @@ const {
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);
// `C` Unicode
const kTraceCount = 67;
// `b` Unicode
const kTraceBegin = 98;
// `e` Unicode
const kTraceEnd = 101;
// `n` Unicode
const kTraceInstant = 110;

const kSecond = 1000;
const kMinute = 60 * kSecond;
Expand Down
7 changes: 5 additions & 2 deletions lib/internal/trace_events_async_hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ const async_hooks = require('async_hooks');
// 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);

// `b` Unicode
const kBeforeEvent = 98;
// `e` Unicode
const kEndEvent = 101;
const kTraceEventCategory = 'node,node.async_hooks';

const kEnabled = Symbol('enabled');
Expand Down