| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -330,6 +330,7 @@ class Parser : public AsyncWrap, public StreamListener { | |||
| 330 | 330 | this, InternalCallbackScope::kSkipTaskQueues); | |
| 331 | 331 | head_response = cb.As<Function>()->Call( | |
| 332 | 332 | env()->context(), object(), arraysize(argv), argv); | |
| 333 | + if (head_response.IsEmpty()) callback_scope.MarkAsFailed(); | ||
| 333 | 334 | } | |
| 334 | 335 | ||
| 335 | 336 | int64_t val; | |
@@ -401,6 +402,7 @@ class Parser : public AsyncWrap, public StreamListener { | |||
| 401 | 402 | InternalCallbackScope callback_scope( | |
| 402 | 403 | this, InternalCallbackScope::kSkipTaskQueues); | |
| 403 | 404 | r = cb.As<Function>()->Call(env()->context(), object(), 0, nullptr); | |
| 405 | + if (r.IsEmpty()) callback_scope.MarkAsFailed(); | ||
| 404 | 406 | } | |
| 405 | 407 | ||
| 406 | 408 | if (r.IsEmpty()) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,29 @@ | |||
| 1 | + 'use strict'; | ||
| 2 | + const common = require('../common'); | ||
| 3 | + const asyncHooks = require('async_hooks'); | ||
| 4 | + const http = require('http'); | ||
| 5 | + | ||
| 6 | + // Regression test for https://github.com/nodejs/node/issues/31796 | ||
| 7 | + | ||
| 8 | + asyncHooks.createHook({ | ||
| 9 | + after: () => {} | ||
| 10 | + }).enable(); | ||
| 11 | + | ||
| 12 | + | ||
| 13 | + process.once('uncaughtException', common.mustCall(() => { | ||
| 14 | + server.close(); | ||
| 15 | + })); | ||
| 16 | + | ||
| 17 | + const server = http.createServer(common.mustCall((request, response) => { | ||
| 18 | + response.writeHead(200, { 'Content-Type': 'text/plain' }); | ||
| 19 | + response.end(); | ||
| 20 | + })); | ||
| 21 | + | ||
| 22 | + server.listen(0, common.mustCall(() => { | ||
| 23 | + http.get({ | ||
| 24 | + host: 'localhost', | ||
| 25 | + port: server.address().port | ||
| 26 | + }, common.mustCall(() => { | ||
| 27 | + throw new Error('whoah'); | ||
| 28 | + })); | ||
| 29 | + })); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments