File tree Expand file tree Collapse file tree 1 file changed +9
-13
lines changed
Expand file tree Collapse file tree 1 file changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -29,24 +29,20 @@ Data.prototype = {
2929 return 0 ;
3030 }
3131
32- var descriptor = { } ,
33- // Check if the owner object already has a cache key
34- unlock = owner [ this . expando ] ;
32+ // Check if the owner object already has a cache key
33+ var unlock = owner [ this . expando ] ;
3534
3635 // If not, create one
3736 if ( ! unlock ) {
3837 unlock = Data . uid ++ ;
3938
40- // Secure it in a non-enumerable, non-writable property
41- try {
42- descriptor [ this . expando ] = { value : unlock } ;
43- Object . defineProperties ( owner , descriptor ) ;
44-
45- // Support: Android<4
46- // Fallback to a less secure definition
47- } catch ( e ) {
48- descriptor [ this . expando ] = unlock ;
49- jQuery . extend ( owner , descriptor ) ;
39+ // If it is a node unlikely to be stringify-ed or looped over
40+ // use plain assignment
41+ if ( owner . nodeType ) {
42+ owner [ this . expando ] = unlock ;
43+ // Otherwise secure it in a non-enumerable, non-writable property
44+ } else {
45+ Object . defineProperty ( owner , this . expando , { value : unlock } ) ;
5046 }
5147 }
5248
You can’t perform that action at this time.
0 commit comments