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 richardlau committed Jul 20, 2021
1 parent 2c28e00 commit ff7cc8f
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 ff7cc8f

Please sign in to comment.