Bug 1301033 - add assert cx on generated code in order to prevent false-positive from static analysis tools. r?baku
MozReview-Commit-ID: ELTP8E3zRNf
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -12316,16 +12316,17 @@ class CGDictionary(CGThing):
if memberInits:
body += fill(
"""
bool isNull = val.isNullOrUndefined();
// We only need these if !isNull, in which case we have |cx|.
Maybe<JS::Rooted<JSObject *> > object;
Maybe<JS::Rooted<JS::Value> > temp;
if (!isNull) {
+ MOZ_ASSERT(cx);
object.emplace(cx, &val.toObject());
temp.emplace(cx);
}
$*{memberInits}
""",
memberInits="\n".join(memberInits))
body += "return true;\n"