/** *Runagroupofoneormoreassertions.Ifanyexceptionsarethrown,catch *themandreportafailure.
*/
ReflectionHarness.test = function(fn, description) { if (this.currentTestDescription) { throw"TEST BUG: test() may not be called recursively!";
} this.currentTestDescription = description; try {
fn(); // Not throwing is a success this.success();
} catch(err) { this.failure("Exception thrown during tests with " + description);
} this.currentTestDescription = null;
}
// Special case for undefined attributes, which we don't want getting in // the way of everything else. if (description.search('^typeof IDL attribute \\(expected ".*", got "undefined"\\)$') != -1) {
type = "undefined";
}
var done = false; var ul = document.getElementById("errors-" + type.replace(" ", "-")); if (ul === null) {
ul = document.createElement("ul");
ul.id = "errors-" + type.replace(" ", "-"); var div = document.getElementById("errors");
p = document.createElement("p"); if (type == "undefined") {
div.parentNode.insertBefore(ul, div.nextSibling);
p.innerHTML = "These IDL attributes were of undefined type, presumably representing unimplemented features (cordoned off into a separate section for tidiness):";
} else {
div.appendChild(ul);
p.innerHTML = "Errors for type " + type + ":";
}
ul.parentNode.insertBefore(p, ul);
} elseif (type != "undefined") { var existingErrors = ul.getElementsByClassName("desc"); for (var i = 0; i < existingErrors.length; i++) { if (existingErrors[i].innerHTML == description) { var typeSpan = existingErrors[i].parentNode.getElementsByClassName("type")[0]; // Check if we have lots of the same error for the same // attribute. If so, we want to collapse them -- the exact // elements that exhibit the error aren't going to be important // to report in this case, and it can take a lot of space if // there's an error in a global attribute like dir or id. var types = typeSpan.innerHTML.split(", "); var count = 0; for (var i = 0; i < types.length; i++) { if (types[i].search("^\\([0-9]* elements\\)\\." + idlName + "$") != -1) {
types[i] = "(" + (1 + parseInt(/[0-9]+/.exec(types[i])[0])) + " elements)." + idlName;
typeSpan.innerHTML = types.join(", "); return;
} elseif (types[i].search("\\." + idlName + "$") != -1) {
count++;
}
} if (comment || count < 10) { // Just add the extra error to the end, not many duplicates // (or we have a comment)
typeSpan.innerHTML += ", " + typeDesc;
} else { var filteredTypes = types.filter(function(type) { return type.search("\\." + idlName + "$") == -1; }); if (filteredTypes.length) {
typeSpan.innerHTML = filteredTypes.join(", ") + ", ";
} else {
typeSpan.innerHTML = "";
}
typeSpan.innerHTML += "(" + (types.length - filteredTypes.length) + " elements)." + idlName;
} return;
}
}
}
/** *Hidealldisplayederrorsmatchingagivenregex,soit'seasiertofilter *outrepetitivefailures.TODO:Fixthissoitworksrightwiththenew *"lumpmanyerrorsinone<li>"thing. * *@private(kindof,onlycalledintheoriginalreflection.html)
*/
ReflectionHarness.maskErrors = function(regex) { var uls = document.getElementsByTagName("ul"); for (var i = 0; i < uls.length; i++) { var lis = uls[i].children; for (var j = 0; j < lis.length; j++) { if (regex !== "" && lis[j].innerHTML.match(regex)) {
lis[j].style.display = "none";
} else {
lis[j].style.display = "list-item";
}
}
}
}
// Now for some stuff that has nothing to do with ReflectionHarness and // everything to do with initialization needed for reflection.js, which seems // pointless to put in an extra file.
var elements = {};
var extraTests = [];
/** *Usedforcombininganumberofsmallarraysofelementdataintoonebig *one.
*/ function mergeElements(src) { for (var key in src) { if (!src.hasOwnProperty(key)) { // This is inherited from a prototype or something. continue;
}
if (key in elements) {
elements[key] = elements[key].concat(src[key]);
} else {
elements[key] = src[key];
}
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.14 Sekunden
(vorverarbeitet am 2026-08-26)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.