Skip to content
This repository was archived by the owner on Oct 19, 2019. It is now read-only.

Commit 2af0df4

Browse files
committed
added global flag check in execAll to prevent infinite loops
1 parent acb70fa commit 2af0df4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/extensions.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ if (!RegExp.prototype.execAll)
55

66
while ((tmp = this.exec(str)) !== null) {
77
arr.push(tmp);
8+
if (!this.global)
9+
break;
810
}
911

1012
return arr;

0 commit comments

Comments
 (0)