forked from mirrors/gecko-dev
Bug 1792555 - key and val arguments to NoteWeakMapping() method can't be null. r=kmag
Add some assertions and drop useless null checks to reflect this. Differential Revision: https://phabricator.services.mozilla.com/D158202
This commit is contained in:
parent
b02ecf7bf2
commit
dbb83041d9
1 changed files with 4 additions and 2 deletions
|
|
@ -2251,12 +2251,14 @@ CCGraphBuilder::NoteWeakMapping(JSObject* aMap, JS::GCCellPtr aKey,
|
|||
NS_IMETHODIMP_(void)
|
||||
CCGraphBuilder::NoteWeakMapping(JSObject* aKey, nsISupports* aVal,
|
||||
nsCycleCollectionParticipant* aValParticipant) {
|
||||
MOZ_ASSERT(aKey, "Don't call NoteWeakMapping with a null key");
|
||||
MOZ_ASSERT(aVal, "Don't call NoteWeakMapping with a null value");
|
||||
WeakMapping* mapping = mGraph.mWeakMaps.AppendElement();
|
||||
mapping->mMap = nullptr;
|
||||
mapping->mKey = aKey ? AddWeakMapNode(aKey) : nullptr;
|
||||
mapping->mKey = AddWeakMapNode(aKey);
|
||||
mapping->mKeyDelegate = mapping->mKey;
|
||||
MOZ_ASSERT(js::UncheckedUnwrapWithoutExpose(aKey) == aKey);
|
||||
mapping->mVal = aVal ? AddNode(aVal, aValParticipant) : nullptr;
|
||||
mapping->mVal = AddNode(aVal, aValParticipant);
|
||||
|
||||
if (mLogger) {
|
||||
mLogger->NoteWeakMapEntry(0, (uint64_t)aKey, 0, (uint64_t)aVal);
|
||||
|
|
|
|||
Loading…
Reference in a new issue