diff options
author | John Resig <jeresig@gmail.com> | 2007-04-29 18:39:07 +0000 |
---|---|---|
committer | John Resig <jeresig@gmail.com> | 2007-04-29 18:39:07 +0000 |
commit | 74a8e206231162b005d95b667343678f786ae272 (patch) | |
tree | f191a86d26f10c46792cf3f4af3055ff385d3db6 /build | |
parent | e95a6cc746f9217fa285a87c2e9c0705babf2824 (diff) | |
download | jquery-74a8e206231162b005d95b667343678f786ae272.tar.gz jquery-74a8e206231162b005d95b667343678f786ae272.zip |
Query now throws no warnings under strict mode in Firefox (ticket #922). In fixing this, revision [1771] was discovered and reverted (no API changes are being added in at this time), and a couple un-functioning test cases were fixed (array comparisions were being done for objects).
Diffstat (limited to 'build')
-rw-r--r-- | build/test/data/testrunner.js | 44 |
1 files changed, 33 insertions, 11 deletions
diff --git a/build/test/data/testrunner.js b/build/test/data/testrunner.js index 337c0dd85..f0e31e7f0 100644 --- a/build/test/data/testrunner.js +++ b/build/test/data/testrunner.js @@ -171,7 +171,7 @@ function ok(a, msg) { */ function isSet(a, b, msg) { var ret = true; - if ( a && b && a.length == b.length ) { + if ( a && b && a.length != undefined && a.length == b.length ) { for ( var i = 0; i < a.length; i++ ) if ( a[i] != b[i] ) ret = false; @@ -183,18 +183,40 @@ function isSet(a, b, msg) { _config.Test.push( [ ret, msg ] ); } +/** + * Asserts that two objects are equivalent + */ +function isObj(a, b, msg) { + var ret = true; + + if ( a && b ) { + for ( var i in a ) + if ( a[i] != b[i] ) + ret = false; + + for ( i in b ) + if ( a[i] != b[i] ) + ret = false; + } else + ret = false; + + _config.Test.push( [ ret, msg ] ); +} + function serialArray( a ) { var r = []; - for ( var i = 0; i < a.length; i++ ) { - var str = a[i].nodeName; - if ( str ) { - str = str.toLowerCase(); - if ( a[i].id ) - str += "#" + a[i].id; - } else - str = a[i]; - r.push( str ); - } + + if ( a && a.length ) + for ( var i = 0; i < a.length; i++ ) { + var str = a[i].nodeName; + if ( str ) { + str = str.toLowerCase(); + if ( a[i].id ) + str += "#" + a[i].id; + } else + str = a[i]; + r.push( str ); + } return "[ " + r.join(", ") + " ]" } |