message: Added matches polyfill, some polyfills.js refactoring
diff: -// Element.prototype.closest
  if (window) {
  - window.Element.prototype.closest = window.Element.prototype.closest || function (css) {
  + const ElementProto = window.Element.prototype;
  +
  + // Element.prototype.matches
  + if (!ElementProto.matches) {
  + ElementProto.matches = ElementProto.matchesSelector ||
  + ElementProto.webkitMatchesSelector ||
  + ElementProto.mozMatchesSelector ||
  + ElementProto.msMatchesSelector;
  + }
  +
  + // Element.prototype.closest
  + if (!ElementProto.closest) {
  + ElementProto.closest = function (css) {
  let node = this;
  while (node) {
  if (node.matches(css)) return node;
  @@ -9,9 +20,11 @@ if (window) {
  return null;
  };
  }
  +}
  // Array.prototype.find
  -Array.prototype.find = Array.prototype.find || function (callback) {
  +if (!Array.prototype.find) {
  + Array.prototype.find = function (callback) {
  if (this === null) {
  throw new TypeError('Array.prototype.find called on null or undefined');
  } else if (typeof callback !== 'function') {
  @@ -29,3 +42,5 @@ Array.prototype.find = Array.prototype.find || function (callback) {
  }
  }
  };
  +}
  +
  