source: trip-planner-front/node_modules/regexp.prototype.flags/polyfill.js@ 84d0fbb

Last change on this file since 84d0fbb was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 650 bytes
Line 
1'use strict';
2
3var implementation = require('./implementation');
4
5var supportsDescriptors = require('define-properties').supportsDescriptors;
6var $gOPD = Object.getOwnPropertyDescriptor;
7var $TypeError = TypeError;
8
9module.exports = function getPolyfill() {
10 if (!supportsDescriptors) {
11 throw new $TypeError('RegExp.prototype.flags requires a true ES5 environment that supports property descriptors');
12 }
13 if ((/a/mig).flags === 'gim') {
14 var descriptor = $gOPD(RegExp.prototype, 'flags');
15 if (descriptor && typeof descriptor.get === 'function' && typeof (/a/).dotAll === 'boolean') {
16 return descriptor.get;
17 }
18 }
19 return implementation;
20};
Note: See TracBrowser for help on using the repository browser.