main
Last change
on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
566 bytes
|
Rev | Line | |
---|
[d565449] | 1 | 'use strict';
|
---|
| 2 |
|
---|
| 3 | var GetIntrinsic = require('get-intrinsic');
|
---|
| 4 |
|
---|
| 5 | var $match = GetIntrinsic('%Symbol.match%', true);
|
---|
| 6 |
|
---|
| 7 | var hasRegExpMatcher = require('is-regex');
|
---|
| 8 |
|
---|
| 9 | var ToBoolean = require('./ToBoolean');
|
---|
| 10 |
|
---|
[79a0317] | 11 | var isObject = require('../helpers/isObject');
|
---|
| 12 |
|
---|
[d565449] | 13 | // https://262.ecma-international.org/6.0/#sec-isregexp
|
---|
| 14 |
|
---|
| 15 | module.exports = function IsRegExp(argument) {
|
---|
[79a0317] | 16 | if (!isObject(argument)) {
|
---|
[d565449] | 17 | return false;
|
---|
| 18 | }
|
---|
| 19 | if ($match) {
|
---|
| 20 | var isRegExp = argument[$match];
|
---|
| 21 | if (typeof isRegExp !== 'undefined') {
|
---|
| 22 | return ToBoolean(isRegExp);
|
---|
| 23 | }
|
---|
| 24 | }
|
---|
| 25 | return hasRegExpMatcher(argument);
|
---|
| 26 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.