rikschennink / conditioner

💆🏻 Frizz free, context-aware, JavaScript modules

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JSON check in _getModuleControllersByElement() fails due to re-use of RegExp instance with global flag

mark-ettema opened this issue · comments

When the global flag is used for a RegExp, the lastindex property is updated for every successful match and reset to 0 when a test end without a result. Every test starts searching from that index.

In this case global flag can be omitted or the lastindex can manually set to 0 before using a new string to test.

commented

Thanks! Will fix in next version.