Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

src,lib,test: make tests mostly pass #149

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/internal/stream_base_commons.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ function afterWriteDispatched(self, req, err) {
if (err !== 0)
return self.destroy(
errnoException(err, 'write', req.error),
req.callback());
req.callback);

if (!req.async && typeof req.callback === 'function') {
req.callback();
Expand Down
4 changes: 2 additions & 2 deletions src/base_object-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,15 +187,15 @@ void BaseObject::decrease_refcount() {
if (new_refcount == 0) {
if (metadata->is_detached) {
delete this;
} else if (metadata->wants_weak_jsobj) {
} else if (metadata->wants_weak_jsobj && !persistent_handle_.IsEmpty()) {
MakeWeak();
}
}
}

void BaseObject::increase_refcount() {
unsigned int prev_refcount = pointer_data()->strong_ptr_count++;
if (prev_refcount == 0)
if (prev_refcount == 0 && !persistent_handle_.IsEmpty())
persistent_handle_.ClearWeak();
}

Expand Down
7 changes: 5 additions & 2 deletions test/parallel/test-process-versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@ const expected_keys = [
'v8',
'zlib',
'nghttp2',
'nghttp3',
'napi',
'llhttp'
];

if (common.hasCrypto) {
expected_keys.push('openssl');
expected_keys.push('ngtcp2');
}

if (common.hasIntl) {
Expand All @@ -28,6 +26,11 @@ if (common.hasIntl) {
expected_keys.push('unicode');
}

if (common.hasQuic) {
expected_keys.push('ngtcp2');
expected_keys.push('nghttp3');
}

expected_keys.sort();
const actual_keys = Object.keys(process.versions).sort();

Expand Down