Skip to content

Commit ff7cc8f

Browse files
addaleaxrichardlau
authored andcommitted
src: add not-weak DCHECK to PersistentToLocal::Strong
Refs: #38821 (comment) PR-URL: #38875 Reviewed-By: Stephen Belanger <[email protected]> Reviewed-By: Bryan English <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
1 parent 2c28e00 commit ff7cc8f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/util.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -760,6 +760,7 @@ class PersistentToLocal {
760760
template <class TypeName>
761761
static inline v8::Local<TypeName> Strong(
762762
const v8::PersistentBase<TypeName>& persistent) {
763+
DCHECK(!persistent.IsWeak());
763764
return *reinterpret_cast<v8::Local<TypeName>*>(
764765
const_cast<v8::PersistentBase<TypeName>*>(&persistent));
765766
}

0 commit comments

Comments
 (0)