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 <[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]>
  • Loading branch information
addaleax authored and richardlau committed Jul 16, 2021
1 parent c53184e commit 84178ec
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 @@ -760,6 +760,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 84178ec

Please sign in to comment.