Fix #8335: Avoid memory leak by never setting data on non-element non-document nodes. Close gh-1127.
Ref cc324abf: use acceptData to determine when it is safe to add event handlers
Test to see if you can amend a commit made by others.
Fix jQuery #13251: use slice instead of substring
(cherry picked from commit 37eb6125c0fb0bec4e0d043bc78110b4f49f3aa6)