The Wayback Machine - https://web.archive.org/web/20220320061547/https://github.com/nodejs/node/commit/b3149cee8c
Skip to content
Permalink
Browse files
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 <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
trevnorris authored and MylesBorins committed Oct 26, 2016
1 parent 3d6f107 commit b3149cee8c41f30e508451becae7ce527f1a9468
Showing with 6 additions and 6 deletions.
  1. +2 −2 src/js_stream.cc
  2. +1 −1 src/js_stream.h
  3. +3 −3 src/node_crypto.h
@@ -22,8 +22,8 @@ using v8::Value;


JSStream::JSStream(Environment* env, Local<Object> obj, AsyncWrap* parent)
: StreamBase(env),
AsyncWrap(env, obj, AsyncWrap::PROVIDER_JSSTREAM, parent) {
: AsyncWrap(env, obj, AsyncWrap::PROVIDER_JSSTREAM, parent),
StreamBase(env) {
node::Wrap(obj, this);
MakeWeak<JSStream>(this);
}
@@ -8,7 +8,7 @@

namespace node {

class JSStream : public StreamBase, public AsyncWrap {
class JSStream : public AsyncWrap, public StreamBase {
public:
static void Initialize(v8::Local<v8::Object> target,
v8::Local<v8::Value> unused,
@@ -319,7 +319,7 @@ class SSLWrap {
// Connection inherits from AsyncWrap because SSLWrap makes calls to
// MakeCallback, but SSLWrap doesn't store the handle itself. Instead it
// assumes that any args.This() called will be the handle from Connection.
class Connection : public SSLWrap<Connection>, public AsyncWrap {
class Connection : public AsyncWrap, public SSLWrap<Connection> {
public:
~Connection() override {
#ifdef SSL_CTRL_SET_TLSEXT_SERVERNAME_CB
@@ -384,8 +384,8 @@ class Connection : public SSLWrap<Connection>, public AsyncWrap {
v8::Local<v8::Object> wrap,
SecureContext* sc,
SSLWrap<Connection>::Kind kind)
: SSLWrap<Connection>(env, sc, kind),
AsyncWrap(env, wrap, AsyncWrap::PROVIDER_CRYPTO),
: AsyncWrap(env, wrap, AsyncWrap::PROVIDER_CRYPTO),
SSLWrap<Connection>(env, sc, kind),
bio_read_(nullptr),
bio_write_(nullptr),
hello_offset_(0) {

0 comments on commit b3149ce

Please sign in to comment.
Morty Proxy This is a proxified and sanitized view of the page, visit original site.