Object.prototype.watch "polyfill"
This implementation behave the closest way possible to Mozilla's one.
There is only one known limitation: delete object[property]
will remove the watchpoint.
It is optimized for minification, only 660 bytes using uglify2.
This is only compilation work, so big thanks to them :
- Based on Eli Grey gist
- Impovements based on Xose Lluis gist
I rediscovered my own code thanks to your comment 🤣. Thanks to highlight wtfpl does not include no-warranty disclamer, i've never thought about it! I'm sure i'll be fine 👍. I'm confident no one will put this in production and think about suing me for an enventual bug... and there actually is a no warranty disclamer in my file, i'm good 😜.