From 3b53992d4ae9dd23744f804272c430f20158837c Mon Sep 17 00:00:00 2001 From: Rodney Rehm Date: Sun, 20 Dec 2015 17:22:24 +0100 Subject: [PATCH 1/2] fix(core): allow loading with no-op in non-browser environment --- src/DOMTokenList-newest.js | 2 +- src/DOMTokenList.js | 2 +- src/classList.js | 2 +- src/relList.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/DOMTokenList-newest.js b/src/DOMTokenList-newest.js index e852196..e9c58fe 100644 --- a/src/DOMTokenList-newest.js +++ b/src/DOMTokenList-newest.js @@ -1,4 +1,4 @@ -;(function (window) { +;typeof window !== 'undefined' && (function (window) { 'use strict'; if (!window.DOMTokenList) { diff --git a/src/DOMTokenList.js b/src/DOMTokenList.js index 04a4144..5a8fe51 100644 --- a/src/DOMTokenList.js +++ b/src/DOMTokenList.js @@ -1,4 +1,4 @@ -;(function (window) { +;typeof window !== 'undefined' && (function (window) { 'use strict'; var arr = []; diff --git a/src/classList.js b/src/classList.js index 97e5ea5..09c34c4 100644 --- a/src/classList.js +++ b/src/classList.js @@ -1,4 +1,4 @@ -;(function () { +;typeof window !== 'undefined' && (function () { 'use strict'; if ('classList' in document.createElement('a') && !window.QUnit) { diff --git a/src/relList.js b/src/relList.js index 3e66779..91b1f0e 100644 --- a/src/relList.js +++ b/src/relList.js @@ -1,4 +1,4 @@ -;(function () { +;typeof window !== 'undefined' && (function () { 'use strict'; if ('relList' in document.createElement('a') && !window.QUnit) { From d2dd0bf5274652b1428ab20ec67a18a69cd8b4a2 Mon Sep 17 00:00:00 2001 From: Rodney Rehm Date: Sun, 20 Dec 2015 17:22:45 +0100 Subject: [PATCH 2/2] updating distributable files --- dist/domtokenlist.js | 8 ++++---- dist/domtokenlist.min.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dist/domtokenlist.js b/dist/domtokenlist.js index d8f6e9c..66dcc30 100644 --- a/dist/domtokenlist.js +++ b/dist/domtokenlist.js @@ -1,5 +1,5 @@ /*! DOMTokenlist shim | Copyright 2015 Jonathan Wilsson and Bogdan Chadkin. */ -;(function (window) { +;typeof window !== 'undefined' && (function (window) { 'use strict'; if (!window.DOMTokenList) { @@ -46,7 +46,7 @@ } }(window)); -;(function (window) { +;typeof window !== 'undefined' && (function (window) { 'use strict'; var arr = []; @@ -176,7 +176,7 @@ window.DOMTokenList = DOMTokenList; }(window)); -;(function () { +;typeof window !== 'undefined' && (function () { 'use strict'; if ('classList' in document.createElement('a') && !window.QUnit) { @@ -190,7 +190,7 @@ }); }()); -;(function () { +;typeof window !== 'undefined' && (function () { 'use strict'; if ('relList' in document.createElement('a') && !window.QUnit) { diff --git a/dist/domtokenlist.min.js b/dist/domtokenlist.min.js index a684da6..24dfbb7 100644 --- a/dist/domtokenlist.min.js +++ b/dist/domtokenlist.min.js @@ -1,2 +1,2 @@ /*! DOMTokenlist shim | Copyright 2015 Jonathan Wilsson and Bogdan Chadkin. */ -!function(t){"use strict";if(t.DOMTokenList){var e=document.createElement("a").classList,n=DOMTokenList.prototype,r=n.add,i=n.remove,o=n.toggle;e.add("c1","c2");var c=function(t){return function(){var e,n=arguments;for(e=0;e