react / wstein / node_modules / jest-cli / node_modules / jsdom / node_modules / cssom / lib / MatcherList.js
81143 views//.CommonJS1var CSSOM = {};2///CommonJS345/**6* @constructor7* @see https://developer.mozilla.org/en/CSS/@-moz-document8*/9CSSOM.MatcherList = function MatcherList(){10this.length = 0;11};1213CSSOM.MatcherList.prototype = {1415constructor: CSSOM.MatcherList,1617/**18* @return {string}19*/20get matcherText() {21return Array.prototype.join.call(this, ", ");22},2324/**25* @param {string} value26*/27set matcherText(value) {28// just a temporary solution, actually it may be wrong by just split the value with ',', because a url can include ','.29var values = value.split(",");30var length = this.length = values.length;31for (var i=0; i<length; i++) {32this[i] = values[i].trim();33}34},3536/**37* @param {string} matcher38*/39appendMatcher: function(matcher) {40if (Array.prototype.indexOf.call(this, matcher) === -1) {41this[this.length] = matcher;42this.length++;43}44},4546/**47* @param {string} matcher48*/49deleteMatcher: function(matcher) {50var index = Array.prototype.indexOf.call(this, matcher);51if (index !== -1) {52Array.prototype.splice.call(this, index, 1);53}54}5556};575859//.CommonJS60exports.MatcherList = CSSOM.MatcherList;61///CommonJS626364