polyfill.js 496 B

12345678910111213141516
  1. 'use strict';
  2. var implementation = require('./implementation');
  3. var supportsDescriptors = require('define-properties').supportsDescriptors;
  4. var $gOPD = Object.getOwnPropertyDescriptor;
  5. module.exports = function getPolyfill() {
  6. if (supportsDescriptors && (/a/mig).flags === 'gim') {
  7. var descriptor = $gOPD(RegExp.prototype, 'flags');
  8. if (descriptor && typeof descriptor.get === 'function' && typeof (/a/).dotAll === 'boolean') {
  9. return descriptor.get;
  10. }
  11. }
  12. return implementation;
  13. };