X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fmanipulation.js;h=da1635400857903f29aa9cd1bc0717670c592ed8;hb=82ac384b494258e17e2856ee2259475ecb0174ca;hp=52f76ed6983b9e4cdf05189bee124611e93e7afc;hpb=faefbb1ad0b81e8001b582d06d5bd9c9236e62ce;p=jquery.git diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js index 52f76ed..da16354 100644 --- a/test/unit/manipulation.js +++ b/test/unit/manipulation.js @@ -1,5 +1,8 @@ module("manipulation"); +// Ensure that an extended Array prototype doesn't break jQuery +Array.prototype.arrayProtoFn = function(arg) { throw("arrayProtoFn should not be called"); }; + var bareObj = function(value) { return value; }; var functionReturningObj = function(value) { return (function() { return value; }); }; @@ -924,16 +927,12 @@ test("clone()", function() { equals( clone.html(), div.html(), "Element contents cloned" ); equals( clone[0].nodeName.toUpperCase(), "DIV", "DIV element cloned" ); - div = jQuery("
").data({ - a: true, b: true, - c: { nesty: ["Block", "Head"] } - }); + div = jQuery("
").data({ a: true }); var div2 = div.clone(true); equals( div2.data("a"), true, "Data cloned." ); - equals( div2.data("b"), true, "Data cloned." ); - var c = div2.data("c"); - c.nesty[0] = "Fish"; - equals( div.data("c").nesty[0], "Block", "Ensure cloned element data is deep copied (Bug #7717)" ); + div2.data("a", false); + equals( div2.data("a"), false, "Ensure cloned element data object was correctly modified" ); + equals( div.data("a"), true, "Ensure cloned element data object is copied, not referenced" ); var form = document.createElement("form"); form.action = "/test/";