Fix MakeWeak and IsWeakRetainer for global handles with finalizers.

BUG=

Review-Url: https://codereview.chromium.org/1944813002
Cr-Commit-Position: refs/heads/master@{#36019}
This commit is contained in:
ulan 2016-05-04 04:56:18 -07:00 committed by Commit bot
parent d441100b70
commit 566c825d4a

View File

@ -205,8 +205,8 @@ class GlobalHandles::Node {
bool IsWeakRetainer() const {
return state() == WEAK || state() == PENDING ||
(state() == NEAR_DEATH && weakness_type() == NORMAL_WEAK &&
weakness_type() != FINALIZER_WEAK);
(state() == NEAR_DEATH && (weakness_type() == NORMAL_WEAK ||
weakness_type() == FINALIZER_WEAK));
}
void MarkPending() {
@ -277,7 +277,7 @@ class GlobalHandles::Node {
set_weakness_type(PHANTOM_WEAK_2_INTERNAL_FIELDS);
break;
case v8::WeakCallbackType::kFinalizer:
set_weakness_type(NORMAL_WEAK);
set_weakness_type(FINALIZER_WEAK);
break;
}
set_parameter(parameter);