polyfill.js 271 B

1234567891011121314
  1. 'use strict';
  2. var implementation = require('./implementation');
  3. module.exports = function getPolyfill() {
  4. if (String.prototype.matchAll) {
  5. try {
  6. ''.matchAll(RegExp.prototype);
  7. } catch (e) {
  8. return String.prototype.matchAll;
  9. }
  10. }
  11. return implementation;
  12. };