]> source.dussan.org Git - jquery.git/commitdiff
Tests: Correct logic of a broken assertion
authorOleg Gaidarenko <markelog@gmail.com>
Tue, 18 Feb 2014 17:46:00 +0000 (21:46 +0400)
committerOleg Gaidarenko <markelog@gmail.com>
Tue, 15 Apr 2014 13:45:59 +0000 (17:45 +0400)
test/unit/attributes.js

index 7839abd8568b3565b8f141878a74ddb507dd2481..0bfe5f073dbb394929c51ce3c4a621c38ff21980 100644 (file)
@@ -374,8 +374,6 @@ test( "attr(String, Object)", function() {
                strictEqual( $elem.attr("nonexisting"), undefined, "attr(name, value) works correctly on comment and text nodes (bug #7500)." );
        });
 
-       // Register the property name to avoid generating a new global when testing window
-       Globals.register("nonexisting");
        jQuery.each( [ window, document, obj, "#firstp" ], function( i, elem ) {
                var oldVal = elem.nonexisting,
                        $elem = jQuery( elem );
@@ -384,6 +382,9 @@ test( "attr(String, Object)", function() {
                elem.nonexisting = oldVal;
        });
 
+       // Register the property on the window for the previous assertion so it will be clean up
+       Globals.register( "nonexisting" );
+
        table = jQuery("#table").append("<tr><td>cell</td></tr><tr><td>cell</td><td>cell</td></tr><tr><td>cell</td><td>cell</td></tr>");
        td = table.find("td").eq(0);
        td.attr( "rowspan", "2" );