String#matchAll polyfill should throw on non-global regex #3517
Labels
internal-issue-created
An internal Google issue has been created to track this GitHub issue
triage-done
Has been reviewed by someone on triage rotation.
"foo".matchAll(/foo/)
should throw but current polyfill doesn't.Previously it didn't throw, but spec was changed on Oct 2019 TC39 meeting.
searchValue
is a non-global RegExp tc39/proposal-string-replaceall#24closure-compiler/src/com/google/javascript/jscomp/js/es6/string/matchall.js
Lines 44 to 47 in 60f0812
MDN is not updated yet.
Chrome 80, Firefox 73, Safari TP and core-js have already implemented the new behavior.
https://kangax.github.io/compat-table/es2016plus/
I think Closure Compiler polyfill should follow the latest spec and major browsers.
The text was updated successfully, but these errors were encountered: