diff options
author | Anna Henningsen <anna@addaleax.net> | 2021-05-31 22:49:32 +0300 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2021-06-11 08:23:52 +0300 |
commit | db4b19211349945015a3096d796ee0d6bd18c46d (patch) | |
tree | 90341c1ef5b208f829e44a63cde30354f0674c70 /src | |
parent | 7d35fa79387e015971225f80b7192d5872fcb559 (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.h | 1 |
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)); } |