Bug 1307142 - correlate MOZ_ASSERT_IF with logic from IsConvertibleToDictionary. r?peterv
MozReview-Commit-ID: 9cPblJOOf8U
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -12550,17 +12550,19 @@ class CGDictionary(CGThing):
we can avoid atomizing strings all the time, then we just spit
out the getMemberConversion() output for each member,
separated by newlines.
"""
body = dedent("""
// Passing a null JSContext is OK only if we're initing from null,
// Since in that case we will not have to do any property gets
- MOZ_ASSERT_IF(!cx, val.isNull());
+ // Also evaluate isNullOrUndefined in order to avoid false-positive
+ // checkers by static analysis tools
+ MOZ_ASSERT_IF(!cx, val.isNull() && val.isNullOrUndefined());
""")
if self.needToInitIds:
body += fill(
"""
${dictName}Atoms* atomsCache = nullptr;
if (cx) {
atomsCache = GetAtomCache<${dictName}Atoms>(cx);