source: imaps-frontend/node_modules/core-js/internals/regexp-exec-abstract.js@ 79a0317

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: 700 bytes
Line 
1'use strict';
2var call = require('../internals/function-call');
3var anObject = require('../internals/an-object');
4var isCallable = require('../internals/is-callable');
5var classof = require('../internals/classof-raw');
6var regexpExec = require('../internals/regexp-exec');
7
8var $TypeError = TypeError;
9
10// `RegExpExec` abstract operation
11// https://tc39.es/ecma262/#sec-regexpexec
12module.exports = function (R, S) {
13 var exec = R.exec;
14 if (isCallable(exec)) {
15 var result = call(exec, R, S);
16 if (result !== null) anObject(result);
17 return result;
18 }
19 if (classof(R) === 'RegExp') return call(regexpExec, R, S);
20 throw new $TypeError('RegExp#exec called on incompatible receiver');
21};
Note: See TracBrowser for help on using the repository browser.