1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 18:47:58 +01:00

Fix util.regexp.iterate for FF43.

This commit is contained in:
Doug Kearns
2015-12-06 21:32:37 +11:00
parent 4356313a09
commit e3c3748511

View File

@@ -1380,7 +1380,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
* @param {number} lastIndex The index at which to begin searching. @optional * @param {number} lastIndex The index at which to begin searching. @optional
*/ */
iterate: function iterate(regexp, string, lastIndex) { iterate: function iterate(regexp, string, lastIndex) {
return iter(new function* () { return iter(function* () {
regexp.lastIndex = lastIndex = lastIndex || 0; regexp.lastIndex = lastIndex = lastIndex || 0;
let match; let match;
while (match = regexp.exec(string)) { while (match = regexp.exec(string)) {
@@ -1390,7 +1390,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
if (match[0].length == 0 || !regexp.global) if (match[0].length == 0 || !regexp.global)
break; break;
} }
}); }());
} }
}), }),