X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fdata.js;h=2d53a710485e80979eceaa4cdf4e18b28bf7982c;hb=b9f5e2b97458f89cbcac3a333ba95b0eac568d49;hp=6efe7b01d45680550f40be7da259496159530f9f;hpb=5b38439011799ae53156d137305d9440e0cddb0a;p=jquery.git diff --git a/src/data.js b/src/data.js index 6efe7b0..2d53a71 100644 --- a/src/data.js +++ b/src/data.js @@ -68,7 +68,9 @@ jQuery.extend({ // TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery // metadata on plain JS objects when the object is serialized using // JSON.stringify - cache[ id ].toJSON = jQuery.noop; + if ( !isNode ) { + cache[ id ].toJSON = jQuery.noop; + } } // An object can be passed to jQuery.data instead of a key/value pair; this gets @@ -168,6 +170,13 @@ jQuery.extend({ // data if it existed if ( internalCache ) { cache[ id ] = {}; + // TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery + // metadata on plain JS objects when the object is serialized using + // JSON.stringify + if ( !isNode ) { + cache[ id ].toJSON = jQuery.noop; + } + cache[ id ][ internalKey ] = internalCache; // Otherwise, we need to eliminate the expando on the node to avoid