mirror of
https://github.com/nodejs/node.git
synced 2026-11-30 11:55:44 -05:00
src: use HandleScope in StreamReq::Done()
Fixes: https://github.com/nodejs/node/issues/38707 PR-URL: https://github.com/nodejs/node/pull/38720 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
1 parent
f50d45961e
commit
ee66cfca79
2 files changed
+14
No files matched your search
@@ -279,6 +279,7 @@ void StreamReq::Done(int status, const char* error_str) {
|
||||
AsyncWrap* async_wrap = GetAsyncWrap();
|
||||
Environment* env = async_wrap->env();
|
||||
if (error_str != nullptr) {
|
||||
v8::HandleScope handle_scope(env->isolate());
|
||||
async_wrap->object()->Set(env->context(),
|
||||
env->error_string(),
|
||||
OneByteString(env->isolate(), error_str))
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
'use strict';
|
||||
|
||||
const common = require('../common');
|
||||
if (!common.hasCrypto)
|
||||
common.skip('missing crypto');
|
||||
|
||||
const https = require('https');
|
||||
|
||||
const request = https.get('https://example.com');
|
||||
|
||||
request.on('socket', (socket) => {
|
||||
socket.unref();
|
||||
});
|
||||
Reference in new issue
Block a user