Skip to content

State explicitly in docs that 'close' does not take any arguments #20018

Closed
@ryzokuken

Description

@ryzokuken

In the http2 module, the Http2Session class emits an event named close, which is documented at https://github.com/nodejs/node/blob/master/doc/api/http2.md#event-close.

As evident from the following function from lib/internal/http2/core.js, the event does not expect any arguments:

function emitClose(self, error) {
  if (error)
    self.emit('error', error);
  self.emit('close');
}

However, the current docs do a poor job of communicating this, therefore creating confusion.

Thus, the fact that the close event does not expect arguments should be explicitly mentioned in the docs.

The exact source can be found at:

node/doc/api/http2.md

Lines 126 to 131 in 6376d43

#### Event: 'close'
<!-- YAML
added: v8.4.0
-->
The `'close'` event is emitted once the `Http2Session` has been destroyed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    docIssues and PRs related to the documentations.good first issueIssues that are suitable for first-time contributors.http2Issues or PRs related to the http2 subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions