X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fmanipulation.js;fp=test%2Funit%2Fmanipulation.js;h=e273cf08a3b790172e1a9659d0c0cc67e2cc72c9;hb=5fd21fc02bda43d4e31bcf2d5b55b918a9190a7f;hp=da1635400857903f29aa9cd1bc0717670c592ed8;hpb=64ee5581afd6e9667ad45e75f082c95e2725efa6;p=jquery.git diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js index da16354..e273cf0 100644 --- a/test/unit/manipulation.js +++ b/test/unit/manipulation.js @@ -1247,3 +1247,20 @@ test("jQuery.cleanData", function() { return div; } }); + +test("jQuery.buildFragment - no plain-text caching (Bug #6779)", function() { + expect(1); + + // DOM manipulation fails if added text matches an Object method + var $f = jQuery( "
" ).appendTo( "#main" ), + bad = [ "start-", "toString", "hasOwnProperty", "append", "here&there!", "-end" ]; + + for ( var i=0; i < bad.length; i++ ) { + try { + $f.append( bad[i] ); + } + catch(e) {} + } + equals($f.text(), bad.join(''), "Cached strings that match Object properties"); + $f.remove(); +});