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 committed Jun 3, 2021
1 parent 21f5a56 commit 62493e9
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 62493e9

Please sign in to comment.