Bug 503190 - Include assertions in the C++ translator output. r=smaug.

This commit is contained in:
Henri Sivonen
2012-10-01 11:52:32 +03:00
parent fc88a5853d
commit e99efa93f4
11 changed files with 94 additions and 85 deletions

View File

@@ -505,25 +505,32 @@ public final class HtmlAttributes implements Attributes {
mode = AttributeName.SVG;
}
public HtmlAttributes cloneAttributes(Interner interner) throws SAXException {
assert (length == 0 && xmlnsLength == 0) || mode == 0 || mode == 3;
public HtmlAttributes cloneAttributes(Interner interner)
throws SAXException {
assert (length == 0
// [NOCPP[
&& xmlnsLength == 0
// ]NOCPP]
)
|| mode == 0 || mode == 3;
HtmlAttributes clone = new HtmlAttributes(0);
for (int i = 0; i < length; i++) {
clone.addAttribute(names[i].cloneAttributeName(interner), Portability.newStringFromString(values[i])
// [NOCPP[
, XmlViolationPolicy.ALLOW
// ]NOCPP]
clone.addAttribute(names[i].cloneAttributeName(interner),
Portability.newStringFromString(values[i])
// [NOCPP[
, XmlViolationPolicy.ALLOW
// ]NOCPP]
);
}
// [NOCPP[
for (int i = 0; i < xmlnsLength; i++) {
clone.addAttribute(xmlnsNames[i],
xmlnsValues[i], XmlViolationPolicy.ALLOW);
clone.addAttribute(xmlnsNames[i], xmlnsValues[i],
XmlViolationPolicy.ALLOW);
}
// ]NOCPP]
return clone; // XXX!!!
}
public boolean equalsAnother(HtmlAttributes other) {
assert mode == 0 || mode == 3 : "Trying to compare attributes in foreign content.";
int otherLength = other.getLength();