Description
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 jquery/jquery#4603
Ref jquery/jquery#5235
Activity
[-] Warn about accessing props from `Object.prototype` in `.data()`[/-][+] Warn about accessing props from `Object.prototype` in `.data()`/`jQuery.event.special`[/+]mgol commentedon Jan 14, 2025
For
3.6.0
, this is handled in #559; for4.0.0
, in #561.mgol commentedon Mar 17, 2025
The fix has landed in #559 for
3.x
& #561 for4.x
, closing.mgol commentedon Mar 17, 2025
Oh, actually, the
jQuery.event.special
part was not addressed yet, reopening.Event: Patch jQuery.event.special's prototype
mgol commentedon Apr 8, 2025
The 3.x PR for
jQuery.event.special
: #572.The 4.0 PR will be created later when some dependends PRs land as described in #572.The 4.0 PR for
jQuery.event.special
: #573.12 remaining items