Skip to content

Commit

Permalink
[Squash] use function instead
Browse files Browse the repository at this point in the history
  • Loading branch information
jasnell committed Sep 23, 2018
1 parent 2dc37cf commit bc5fd8e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
11 changes: 6 additions & 5 deletions doc/api/http2.md
Original file line number Diff line number Diff line change
Expand Up @@ -411,16 +411,17 @@ added: v9.4.0
Transmits a `GOAWAY` frame to the connected peer *without* shutting down the
`Http2Session`.

#### http2session.lastReceivedTime
#### http2session.getLastReceivedTime()
<!-- YAML
added: REPLACEME
-->

* {number}
* Returns: {number}

A timestamp indicating the moment the most recently received communication of
any kind was received from the connected peer. A value of `0` indicates that
the session is still open but no data has yet been received.
Returns a timestamp indicating the moment the most recently received
communication of any kind was received from the connected peer. A value of `0`
indicates that the session is still open but no data has yet been received.
A value of `undefined` indicates that the session is no longer valid.

#### http2session.localSettings
<!-- YAML
Expand Down
2 changes: 1 addition & 1 deletion lib/internal/http2/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,7 @@ class Http2Session extends EventEmitter {
return !!(this[kState].flags & SESSION_FLAGS_DESTROYED);
}

get lastReceivedTime() {
getLastReceivedTime() {
return !this.destroyed ? this[kHandle].getLastReceivedTime() : undefined;
}

Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-http2-session-lastreceivedtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const assert = require('assert');

const server = createServer();
server.on('stream', mustCall((stream) => {
assert(stream.session.lastReceivedTime > 0);
assert(stream.session.getLastReceivedTime() > 0);
stream.respond();
stream.end('ok');
}));
Expand All @@ -25,7 +25,7 @@ server.listen(0, mustCall(() => {

const req = client.request();
req.on('response', mustCall(() => {
assert(client.lastReceivedTime > 0);
assert(client.getLastReceivedTime() > 0);
}));
req.resume();
req.on('close', mustCall(() => {
Expand Down

0 comments on commit bc5fd8e

Please sign in to comment.