jquery-migrate icon indicating copy to clipboard operation
jquery-migrate copied to clipboard

Warn about accessing props from `Object.prototype` in `.data()`/`jQuery.event.special`

Open mgol opened this issue 1 year ago • 0 comments

Since 4.0, .data() no longer inherits from Object.prototype; the same applies to the events object from the private data store.

We should not restore the old behavior as that will reintroduce potential collisions with Object.prototype. We should, though, warn if a key matching a key from Object.prototype is read.

Let's also handle jQuery.event.special which underwent the same changes.

Ref https://github.com/jquery/jquery/pull/4603 Ref https://github.com/jquery/jquery/pull/5235

mgol avatar Oct 09 '24 21:10 mgol