var error = false; var url; try { if (test.base) {
url = new URL(test.url, test.base);
} else {
url = new URL(test.url);
}
} catch (e) {
error = true;
}
is(test.error, error, "Error creating URL"); if (test.error) { continue;
}
if ("href" in test) {
is(url.href, test.href, "href");
} if ("origin" in test) {
is(url.origin, test.origin, "origin");
} if ("protocol" in test) {
is(url.protocol, test.protocol, "protocol");
} if ("username" in test) {
is(url.username, test.username, "username");
} if ("password" in test) {
is(url.password, test.password, "password");
} if ("host" in test) {
is(url.host, test.host, "host");
} if ("hostname" in test) {
is(url.hostname, test.hostname, "hostname");
} if ("port" in test) {
is(url.port, test.port, "port");
} if ("pathname" in test) {
is(url.pathname, test.pathname, "pathname");
} if ("search" in test) {
is(url.search, test.search, "search");
} if ("hash" in test) {
is(url.hash, test.hash, "hash");
}
if ("href" in test) {
url.href = test.href;
} if ("protocol" in test) {
url.protocol = test.protocol;
} if ("username" in test && test.username) {
url.username = test.username;
} if ("password" in test && test.password) {
url.password = test.password;
} if ("host" in test) {
url.host = test.host;
} if ("hostname" in test) {
url.hostname = test.hostname;
} if ("port" in test) {
url.port = test.port;
} if ("pathname" in test) {
url.pathname = test.pathname;
} if ("search" in test) {
url.search = test.search;
} if ("hash" in test) {
url.hash = test.hash;
}
if ("href" in test) {
is(url.href, test.href, "href");
} if ("origin" in test) {
is(url.origin, test.origin, "origin");
} if ("expectedChangedProtocol" in test) {
is(url.protocol, test.expectedChangedProtocol, "protocol");
} elseif ("protocol" in test) {
is(url.protocol, test.protocol, "protocol");
} if ("username" in test) {
is(url.username, test.username, "username");
} if ("password" in test) {
is(url.password, test.password, "password");
} if ("host" in test) {
is(url.host, test.host, "host");
} if ("hostname" in test) {
is(test.hostname, url.hostname, "hostname");
} if ("port" in test) {
is(test.port, url.port, "port");
} if ("pathname" in test) {
is(test.pathname, url.pathname, "pathname");
} if ("search" in test) {
is(test.search, url.search, "search");
} if ("hash" in test) {
is(test.hash, url.hash, "hash");
}
if ("href" in test) {
is(test.href, url + "", "stringify works");
}
}
postMessage({ type: "finish" });
};
Messung V0.5
¤ Dauer der Verarbeitung: 0.16 Sekunden
(vorverarbeitet)
¤
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.