Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2021-05-31 22:49:32 +0300
committerAnna Henningsen <anna@addaleax.net>2021-06-03 13:16:21 +0300
commit62493e9da2723cf6ebe1a6a1a2cd97c8db545b6e (patch)
treeb230dd6b66c4cb67e045db54708117bded340c02 /src
parent21f5a56914a3b24ad77535ef369b93c6b1c11d18 (diff)
src: add not-weak DCHECK to PersistentToLocal::Strong
Refs: https://github.com/nodejs/node/pull/38821#issuecomment-851644135 PR-URL: https://github.com/nodejs/node/pull/38875 Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Bryan English <bryan@bryanenglish.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Diffstat (limited to 'src')
-rw-r--r--src/util.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h
index 4ee97e24cac..79ad3dfe2d0 100644
--- a/src/util.h
+++ b/src/util.h
@@ -772,6 +772,7 @@ class PersistentToLocal {
template <class TypeName>
static inline v8::Local<TypeName> Strong(
const v8::PersistentBase<TypeName>& persistent) {
+ DCHECK(!persistent.IsWeak());
return *reinterpret_cast<v8::Local<TypeName>*>(
const_cast<v8::PersistentBase<TypeName>*>(&persistent));
}