void DeprecationReportBody::ToJSON(JSONWriter& aWriter) const {
  aWriter.StringProperty("id", NS_ConvertUTF16toUTF8(mId).get());
  // TODO: anticipatedRemoval? https://github.com/w3c/reporting/issues/132
  aWriter.StringProperty("message", NS_ConvertUTF16toUTF8(mMessage).get());

  if (mSourceFile.IsEmpty()) {
    aWriter.NullProperty("sourceFile");
  } else {
    aWriter.StringProperty("sourceFile",
                           NS_ConvertUTF16toUTF8(mSourceFile).get());
  }

  if (mLineNumber.IsNull()) {
    aWriter.NullProperty("lineNumber");
  } else {
    aWriter.IntProperty("lineNumber", mLineNumber.Value());
  }

  if (mColumnNumber.IsNull()) {
    aWriter.NullProperty("columnNumber");
  } else {
    aWriter.IntProperty("columnNumber", mColumnNumber.Value());
  }
}