Last change
on this file 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 |
|
---|
3 | var implementation = require('./implementation');
|
---|
4 |
|
---|
5 | var supportsDescriptors = require('define-properties').supportsDescriptors;
|
---|
6 | var $gOPD = Object.getOwnPropertyDescriptor;
|
---|
7 | var $TypeError = TypeError;
|
---|
8 |
|
---|
9 | module.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.