'use strict';varGetIntrinsic=require('../GetIntrinsic');var$TypeError=GetIntrinsic('%TypeError%');varregexExec=require('../helpers/callBound')('RegExp.prototype.exec');varCall=require('./Call');varGet=require('./Get');varIsCallable=require('./IsCallable');varType=require('./Type');// https://ecma-international.org/ecma-262/6.0/#sec-regexpexecmodule.exports=functionRegExpExec(R,S){if(Type(R)!=='Object'){thrownew$TypeError('Assertion failed: `R` must be an Object');}if(Type(S)!=='String'){thrownew$TypeError('Assertion failed: `S` must be a String');}varexec=Get(R,'exec');if(IsCallable(exec)){varresult=Call(exec,R,[S]);if(result===null||Type(result)==='Object'){returnresult;}thrownew$TypeError('"exec" method must return `null` or an Object');}returnregexExec(R,S);};