1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-16 01:55:46 +01:00

util.regexp.iterate

--HG--
extra : rebase_source : 2c9d5a20ceb0a3ffde32ad8989ce6f594df8c406
This commit is contained in:
Kris Maglione
2011-01-20 05:39:27 -05:00
parent 89d57a9106
commit 8ab964fedb
3 changed files with 32 additions and 23 deletions

View File

@@ -161,9 +161,7 @@ var Template = Module("Template", {
highlightRegexp: function highlightRegexp(str, re, highlight) {
return this.highlightSubstrings(str, (function () {
re.lastIndex = 0;
let res;
while ((res = re.exec(str)) && res[0].length)
for (let res in util.regexp.iterate(re, str))
yield [res.index, res[0].length, res.wholeMatch ? [res] : res];
})(), highlight || template.filter);
},