jQuery.extend(true,{foo:"bar"},{foo:null}); //throws an exception

jQuery.extend(true,{foo:"bar"},{foo:null}); //throws an exception

<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">Hi,<DIV>When running my unit tests in the jQuery testing harness (a few days old from svn) I found that </DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>jQuery.extend(true,{foo:"bar"},{foo:null});</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>will throw an exception with the message:</DIV><DIV> TypeError: Cannot read property "nodeType" from null</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>I believe that jQuery.extend is missing a test for this, so I changed</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>// Recurse if we're merging object values</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>if ( deep && typeof options[ name ] == "object" && target[ name ] && !options[ name ].nodeType )</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>to</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>// Recurse if we're merging object values</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>if ( deep && options[ name ] && typeof options[ name ] == "object" && target[ name ] && !options[ name ].nodeType )</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>and everything works as intended.  I guess that this is supposed to be included in the test ' typeof options[ name ] == "object" ', but the following test cases illustrate this isnt quite enough since:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>equals( false, (typeof null == "object"), "null is an object?");</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>equals( false, (typeof null === "object"), "null is an object?");</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>yield</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>     [java] FAIL (114) [claypool.application] null is an object? expected: false actual: true</DIV><DIV>     [java] FAIL (115) [claypool.application] null is an object? expected: false actual: true</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV>Chris Thatcher</DIV><DIV>(cell) 202 340 9685</DIV><DIV><A href="mailto:christopher.thatcher@comcast.net"> christopher.thatcher@comcast.net</A></DIV><DIV><A href="mailto:chth@loc.gov"> chth@loc.gov</A></DIV><DIV><BR class="khtml-block-placeholder"></DIV><BR class="Apple-interchange-newline"></SPAN></SPAN></SPAN> </DIV><BR></DIV>