You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using and loving this library. Found a bug with the String.contains polyfill. Another library was calling a for in loop on a string and the contains function was showing as a property. That library was then calling the function anonymously which led to an exception being thrown. We included a fix in our code before importing your library and I'm sharing it with you if you are interested in applying it to this library:
if(!String.prototype.contains){
Object.defineProperty(String.prototype, 'contains', {
enumerable: false,
value: function() {
return String.prototype.indexOf.apply(this, arguments) !== -1;
}
});
}
You can test out the fix by running the following code before and after this fix:
for(var i in ''){ console.log(i);var fn = ''[i]; fn();}
The text was updated successfully, but these errors were encountered:
Using and loving this library. Found a bug with the String.contains polyfill. Another library was calling a for in loop on a string and the contains function was showing as a property. That library was then calling the function anonymously which led to an exception being thrown. We included a fix in our code before importing your library and I'm sharing it with you if you are interested in applying it to this library:
if(!String.prototype.contains){
Object.defineProperty(String.prototype, 'contains', {
enumerable: false,
value: function() {
return String.prototype.indexOf.apply(this, arguments) !== -1;
}
});
}
You can test out the fix by running the following code before and after this fix:
for(var i in ''){ console.log(i);var fn = ''[i]; fn();}
The text was updated successfully, but these errors were encountered: