- From: Anne van Kesteren <notifications@github.com>
- Date: Wed, 06 Jan 2016 09:10:25 -0800
- To: whatwg/dom <dom@noreply.github.com>
Received on Wednesday, 6 January 2016 17:10:57 UTC
> +var DOMTokenListSupports = function(tokenList, token) {
> + if (!tokenList || !tokenList.supports) {
> + return false;
> + }
> + try {
> + return tokenList.supports(token);
> + } catch (e) {
> + if (e instanceof TypeError) {
> + console.log("The DOMTokenList doesn't have a supported tokens list");
> + } else {
> + console.error("That shouldn't have happened");
> + }
> + }
> +};
> +
> +var linkSupportsPreload = tokenListSupports(document.createElement("link").relList, "preload"); // true
Perhaps it's better to leave the actual token here as a variable.
---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/pull/144/files#r48981870
Received on Wednesday, 6 January 2016 17:10:57 UTC