Skip to content

Commit b3149ce

Browse files
trevnorrisMylesBorins
authored andcommitted
src: inherit first from AsyncWrap
To make sure casting a class of multiple inheritance from a void* to AsyncWrap succeeds make AsyncWrap the first inherited class. PR-URL: #6184 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent 3d6f107 commit b3149ce

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/js_stream.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ using v8::Value;
2222

2323

2424
JSStream::JSStream(Environment* env, Local<Object> obj, AsyncWrap* parent)
25-
: StreamBase(env),
26-
AsyncWrap(env, obj, AsyncWrap::PROVIDER_JSSTREAM, parent) {
25+
: AsyncWrap(env, obj, AsyncWrap::PROVIDER_JSSTREAM, parent),
26+
StreamBase(env) {
2727
node::Wrap(obj, this);
2828
MakeWeak<JSStream>(this);
2929
}

src/js_stream.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
namespace node {
1010

11-
class JSStream : public StreamBase, public AsyncWrap {
11+
class JSStream : public AsyncWrap, public StreamBase {
1212
public:
1313
static void Initialize(v8::Local<v8::Object> target,
1414
v8::Local<v8::Value> unused,

src/node_crypto.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ class SSLWrap {
319319
// Connection inherits from AsyncWrap because SSLWrap makes calls to
320320
// MakeCallback, but SSLWrap doesn't store the handle itself. Instead it
321321
// assumes that any args.This() called will be the handle from Connection.
322-
class Connection : public SSLWrap<Connection>, public AsyncWrap {
322+
class Connection : public AsyncWrap, public SSLWrap<Connection> {
323323
public:
324324
~Connection() override {
325325
#ifdef SSL_CTRL_SET_TLSEXT_SERVERNAME_CB
@@ -384,8 +384,8 @@ class Connection : public SSLWrap<Connection>, public AsyncWrap {
384384
v8::Local<v8::Object> wrap,
385385
SecureContext* sc,
386386
SSLWrap<Connection>::Kind kind)
387-
: SSLWrap<Connection>(env, sc, kind),
388-
AsyncWrap(env, wrap, AsyncWrap::PROVIDER_CRYPTO),
387+
: AsyncWrap(env, wrap, AsyncWrap::PROVIDER_CRYPTO),
388+
SSLWrap<Connection>(env, sc, kind),
389389
bio_read_(nullptr),
390390
bio_write_(nullptr),
391391
hello_offset_(0) {

0 commit comments

Comments
 (0)