source: frontend/node_modules/es-abstract/2020/IsRegExp.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 570 bytes
Line 
1'use strict';
2
3var GetIntrinsic = require('get-intrinsic');
4
5var $match = GetIntrinsic('%Symbol.match%', true);
6
7var hasRegExpMatcher = require('is-regex');
8var isObject = require('es-object-atoms/isObject');
9
10var ToBoolean = require('./ToBoolean');
11
12// https://262.ecma-international.org/6.0/#sec-isregexp
13
14module.exports = function IsRegExp(argument) {
15 if (!isObject(argument)) {
16 return false;
17 }
18 if ($match) {
19 var isRegExp = argument[$match];
20 if (typeof isRegExp !== 'undefined') {
21 return ToBoolean(isRegExp);
22 }
23 }
24 return hasRegExpMatcher(argument);
25};
Note: See TracBrowser for help on using the repository browser.