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.
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.