Fix type of createPushResponse() in node http2. (#20510)

* Fix type of createPushResponse() in node http2.

From https://github.com/nodejs/node/blob/master/lib/internal/http2/compat.js#L628:
`callback` is required to be a function. And its second argument is an `Http2ServerResponse`.

* `err` is nullable.

* delete redundant tests that have partial arguments
This commit is contained in:
Jinwoo Lee
2017-10-17 08:35:55 -07:00
committed by Andy
parent a531f8c43d
commit fb93c75e47
2 changed files with 2 additions and 3 deletions
+1 -2
View File
@@ -3353,8 +3353,7 @@ namespace http2_tests {
let headersSent: boolean = response.headersSent;
response.setTimeout(0, () => {});
response.createPushResponse(outgoingHeaders);
response.createPushResponse(outgoingHeaders, (err: Error) => {});
response.createPushResponse(outgoingHeaders, (err: Error | null, res: http2.Http2ServerResponse) => {});
response.writeContinue();
response.writeHead(200);