Skip to content

Commit

Permalink
src: add not-weak DCHECK to PersistentToLocal::Strong
Browse files Browse the repository at this point in the history
Refs: #38821 (comment)

PR-URL: #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>
  • Loading branch information
addaleax authored and targos committed Jun 11, 2021
1 parent 7d35fa7 commit db4b192
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down

0 comments on commit db4b192

Please sign in to comment.