add support for TracingChannel#hasSubscribers, test Node.js v22#11
Merged
Conversation
TracingChannel#hasSubscribersTracingChannel#hasSubscribers, test Node.js v22
8 tasks
bengl
reviewed
May 8, 2024
| dc.tracingChannel = function() { | ||
| const tc = tracingChannel(...arguments); | ||
|
|
||
| Object.defineProperty(tc, 'hasSubscribers', { // TODO: on prototype? |
Contributor
There was a problem hiding this comment.
Could you do it on the prototype by creating a throwaway TracingChannel and getting its prototype?
Member
Author
There was a problem hiding this comment.
That's just crazy enough to work
bengl
reviewed
May 8, 2024
| // if there is a TracingChannel#hasSubscribers() method | ||
| // @see https://github.com/nodejs/node/pull/51915 | ||
| // TODO: note that we still need to add the TC early exit from this same version | ||
| function hasTracingChannelHasSubscribersMethod() { |
Contributor
There was a problem hiding this comment.
hasSubscribers is an accessor/property, not a method.
d4ab58f to
69fec35
Compare
bengl
reviewed
May 9, 2024
| { | ||
| const fauxTrCh = dc.tracingChannel('dc-polyfill-faux'); | ||
|
|
||
| const TracingChannel = ObjectGetPrototypeOf(fauxTrCh); |
Contributor
There was a problem hiding this comment.
Maybe TracingChannelPrototype or tracingChannelPrototype, or proto or something else to indicate that it's the prototype object, and not the class/constructor.
69fec35 to
64e48fd
Compare
bengl
approved these changes
May 9, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
diagnostics_channelchanges landed in Node.js in diagnostics_channel: early-exit tracing channel trace methods nodejs/node#51915TracingChannel#hasSubscribershelper method available in Node.js v22 and v20.13