'use strict';// https://tc39.github.io/String.prototype.matchAll/var$export=require('./_export');vardefined=require('./_defined');vartoLength=require('./_to-length');varisRegExp=require('./_is-regexp');vargetFlags=require('./_flags');varRegExpProto=RegExp.prototype;var$RegExpStringIterator=function(regexp,string){this._r=regexp;this._s=string;};require('./_iter-create')($RegExpStringIterator,'RegExp String',functionnext(){varmatch=this._r.exec(this._s);return{value:match,done:match===null};});$export($export.P,'String',{matchAll:functionmatchAll(regexp){defined(this);if(!isRegExp(regexp))throwTypeError(regexp+' is not a regexp!');varS=String(this);varflags='flags'inRegExpProto?String(regexp.flags):getFlags.call(regexp);varrx=newRegExp(regexp.source,~flags.indexOf('g')?flags:'g'+flags);rx.lastIndex=toLength(regexp.lastIndex);returnnew$RegExpStringIterator(rx,S);}});