http2: adjust error emit in core, add tests

Use the ability of nextTick and setImmediate to pass arguments
instead of creating closures or binding. Add tests that cover
the vast majority of error emits.

PR-URL: https://github.com/nodejs/node/pull/15586
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
Anatoli Papirovski 2017-09-30 10:06:21 -04:00 committed by Ruben Bridgewater
parent dcd890a135
commit ccd3afc843
No known key found for this signature in database
GPG key ID: F07496B3EB3C1762
11 changed files with 793 additions and 115 deletions

View file

@ -81,7 +81,6 @@ server.on('stream', common.mustCall((stream, headers) => {
const errorMustNotCall = common.mustNotCall(
`${currentError.error.code} should emit on ${currentError.type}`
);
console.log(currentError);
if (currentError.type === 'stream') {
stream.session.on('error', errorMustNotCall);