If I modify Object.prototype in a seemingly harmless way (just add any property to it), the library Chart.js cannot even load:
<script>
Object.prototype.someNewProperty='some value'
</script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.2/Chart.bundle.min.js'></script>
I got an error in the console: Uncaught TypeError: Cannot read property '1' of null
.
If I remove the line Object.prototype.someNewProperty='some value'
everything works fine.
What is the source of the problem? How Chart.js knows that I have modified Object.prototype and how this modification prevents the library from being loaded?