- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 33.7k
 
Open
Labels
async_hooksIssues and PRs related to the async hooks subsystem.Issues and PRs related to the async hooks subsystem.
Description
Currently, the AsyncResource constructor requires a type argument, e.g. new AsyncResource('foo'). It will throw if this is not provided. This information, however, is only used for async_hooks integration and is not necessary for async context propagation. I'd like to propose that we make the argument optional, defaulting its value to this.constructor?.name || 'AsyncResource' when it is not provided.
/cc @Qard @legendecas @nodejs/async_hooks
legendecas, Qard, AndreasMadsen and tony-go
Metadata
Metadata
Assignees
Labels
async_hooksIssues and PRs related to the async hooks subsystem.Issues and PRs related to the async hooks subsystem.