The startsWith and endWith methods are overridden/prototyped by default in jquery-ext.js. When these methods are already available in the browser these methods should not be overridden.
I stumbled upon these methods when a custom javascript app refused to run, because of these prototyped methods. When I disabled the override, the app ran just fine.
Yes, good point. This compatibility code is rather old and I don't know the reason why it is there in the first place. But your workaround looks very sensible. I'll also backport that to patternslib. Thank you!
The
startsWith
andendWith
methods are overridden/prototyped by default injquery-ext.js
. When these methods are already available in the browser these methods should not be overridden.Maybe the protoTypes should be removed altogether? Most (if not all) modern browsers now support these methods. It also seems the implementation is not correct. For example
startsWith
can also accept a 2th argument for position (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith).I stumbled upon these methods when a custom javascript app refused to run, because of these prototyped methods. When I disabled the override, the app ran just fine.