string replaceAll breaks normal js replaceAll
jsqldb opened this issue · comments
Konrad von Backström commented
To reproduce:
Normal behaviour, when sugar is not included
'apple_apple'.replaceAll('apple','orange')
results in:
'orange_orange'
(This can be tested by opening chome dev tools on any web page)
If you include sugar, you will get this
'apple_apple'.replaceAll('apple','orange')
results in:
'orange_'
(This can be tested by opening chome dev tools on any https://sugarjs.com/, where sugar is included)
This is vary bad, because it will break all other code that uses replaceAll, including from included libs and your own js code.
Konrad von Backström commented
Actually you can just not use Extended Mode then you won't have this problem. So all good.