ccxvii / mujs

An embeddable Javascript interpreter in C.
http://mujs.com/
ISC License
807 stars 98 forks source link

Incorrect match.index property on RegEx #150

Closed dbogatz closed 3 years ago

dbogatz commented 3 years ago
var re = /<%(.+?)%>/g, html = "<%hund%><%katze%><%maus%>", match;

 while(match = re.exec(html)) {
      console.log("index: "+match.index);
 }

Expected: index: 0 index: 8 index: 17

MuJS: index: 0 index: 0 index: 0