MCPcopy
hub / github.com/gabrielecirulli/2048 / DOMTokenList

Function DOMTokenList

js/classlist_polyfill.js:12–20  ·  view source on GitHub ↗
(el)

Source from the content-addressed store, hash-verified

10 join = prototype.join;
11
12 function DOMTokenList(el) {
13 this.el = el;
14 // The className needs to be trimmed and split on whitespace
15 // to retrieve a list of classes.
16 var classes = el.className.replace(/^\s+|\s+$/g, '').split(/\s+/);
17 for (var i = 0; i < classes.length; i++) {
18 push.call(this, classes[i]);
19 }
20 }
21
22 DOMTokenList.prototype = {
23 add: function (token) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected