id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	blocking	blockedby
8476	Strange behavior with appendTo	fguillot@…		"Hello,

I'm trying to create my first jQuery plugin, a ""game of fifteen"" (taquin in french) and everything is fine except I have a very strange behavior when using the appendTo method.

Firebug throws the following exception : uncaught exception: [Exception... ""Could not convert JavaScript argument arg 0 [nsIDOMDocumentFragment.appendChild]"" nsresult: ""0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)"" location: ""JS frame :: http://code.jquery.com/jquery-1.5.1.js :: anonymous :: line 5636"" data: no]

Here is a [http://jsfiddle.net/mMLBD/2/ test case]. To reproduce the bug, click Start once, then Reset twice. It will trigger on the second reset (with any settings). Reset just rebuild the board game, keeping the same settings.

While debugging myself, I've noticed that on line 5558 of jQuery 1.5.1 (method ""clean"") there is this array created : ""var ret = [];"". When the bug triggers, if you put a break point after this line, the array is shown as empty in the firebug spy window, but if you open the spy, you can see that there are ""1"" in the array; one for each time the bug triggered. This is what drives jQuery crazy."	bug	closed	undecided	1.next	unfiled	1.5.1	invalid				
