]> source.dussan.org Git - jquery.git/commitdiff
Build: ESLint details 3148/head
authorOleg Gaidarenko <markelog@gmail.com>
Tue, 10 May 2016 09:12:28 +0000 (12:12 +0300)
committerOleg Gaidarenko <markelog@gmail.com>
Sat, 11 Jun 2016 07:41:33 +0000 (10:41 +0300)
Use eslint pragmas, fix new errors, etc

Closes gh-3148

46 files changed:
.eslintignore
.eslintrc
.gitignore
.jshintignore [deleted file]
Gruntfile.js
build/.eslintrc [deleted file]
build/release.js
build/tasks/build.js
build/tasks/lib/spawn_test.js
dist/.eslintrc [new file with mode: 0644]
package.json
src/.eslintrc
src/ajax.js
src/attributes/val.js
src/core.js
src/css/adjustCSS.js
src/data/var/acceptData.js
src/deferred.js
src/effects.js
src/exports/global.js
src/manipulation.js
src/selector.js
src/traversing/findFilter.js
src/wrapper.js
test/.eslintrc
test/data/testinit.js
test/node_smoke_tests/.eslintrc
test/node_smoke_tests/iterable_with_symbol_polyfill.js
test/node_smoke_tests/lib/ensure_iterability_es6.js
test/promises_aplus_adapters/.eslintrc
test/unit/ajax.js
test/unit/attributes.js
test/unit/core.js
test/unit/css.js
test/unit/data.js
test/unit/deferred.js
test/unit/deprecated.js
test/unit/dimensions.js
test/unit/effects.js
test/unit/event.js
test/unit/manipulation.js
test/unit/offset.js
test/unit/queue.js
test/unit/selector.js
test/unit/serialize.js
test/unit/wrap.js

index adfbe3f4bffb9637340cf46fdd1fec0c29f882e6..ce591757100e75cc76544013212e53bc4de2e8a8 100644 (file)
@@ -1,4 +1,6 @@
 external
+node_modules
+dist/jquery.min.js
 test/data/jquery-1.9.1.js
 test/data/badcall.js
 test/data/badjson.js
@@ -8,5 +10,3 @@ test/data/readywaitloader.js
 test/data/support/csp.js
 test/data/support/getComputedSupport.js
 test/node_smoke_tests/lib/ensure_iterability.js
-node_modules
-dist
index 4bb05b235105ab688721feb8847dcd914ab75087..6dcb6353a48f180fc77fd2b3233b83959fa6aa7d 100644 (file)
--- a/.eslintrc
+++ b/.eslintrc
@@ -1,145 +1,7 @@
 {
-       "env": {},
-       "globals": {},
-       "rules": {
-               "no-cond-assign": [
-                       "error",
-                       "except-parens"
-               ],
-               "curly": [
-                       "error",
-                       "all"
-               ],
-               "object-curly-spacing": [
-                       "error",
-                       "always"
-               ],
-               "computed-property-spacing": [
-                       "error",
-                       "always"
-               ],
-               "array-bracket-spacing": [
-                       "error",
-                       "always"
-               ],
-               "eqeqeq": [
-                       "error",
-                       "smart"
-               ],
-
-               // Shows errors where jshint wouldn't (see jshint "expr" rule)
-               // clarifing this with eslint team
-               // "no-unused-expressions": "error",
-               "wrap-iife": [
-                       "error",
-                       "inside"
-               ],
-               "no-caller": "error",
-               "quotes": [
-                       "error",
-                       "double",
-                       "avoid-escape"
-               ],
-               "no-undef": "error",
-               "no-unused-vars": "error",
-               "operator-linebreak": [
-                       "error",
-                       "after"
-               ],
-               "comma-style": [
-                       "error",
-                       "last"
-               ],
-               "camelcase": [
-                       "error",
-                       {
-                               "properties": "never"
-                       }
-               ],
-               "dot-notation": [
-                       "error",
-                       {
-                               "allowPattern": "^[a-z]+(_[a-z]+)+$"
-                       }
-               ],
-               "max-len": [
-                       "error",
-                       {
-                               "code": 100,
-                               "ignoreComments": true
-                       }
-               ],
-               "no-mixed-spaces-and-tabs": "error",
-               "no-trailing-spaces": "error",
-               "no-multi-str": "error",
-               "comma-dangle": [
-                       "error",
-                       "never"
-               ],
-               "comma-spacing": [
-                       "error",
-                       {
-                               "before": false,
-                               "after": true
-                       }
-               ],
-               "space-before-blocks": [
-                       "error",
-                       "always"
-               ],
-               "space-in-parens": [
-                       "error",
-                       "always"
-               ],
-               "keyword-spacing": [
-                       2
-               ],
-               "semi": [
-                       "error",
-                       "always"
-               ],
-               "semi-spacing": [
-                       "error",
-                       {
-                               // Because of the `for ( ; ...)` requirement
-                               // "before": true,
-                               "after": true
-                       }
-               ],
-               "space-infix-ops": "error",
-               "eol-last": "error",
-               "lines-around-comment": [
-                       "error",
-                       {
-                               "beforeLineComment": true
-                       }
-               ],
-               "linebreak-style": [
-                       "error",
-                       "unix"
-               ],
-               "no-with": "error",
-               "brace-style": "error",
-               "space-before-function-paren": [
-                       "error",
-                       "never"
-               ],
-               "no-loop-func": "error",
-               "no-spaced-func": "error",
-               "key-spacing": [
-                       "error",
-                       {
-                               "beforeColon": false,
-                               "afterColon": true
-                       }
-               ],
-               "space-unary-ops": [
-                       "error",
-                       {
-                               "words": false,
-                               "nonwords": false
-                       }
-               ],
-               "no-multiple-empty-lines": 2
+       "extends": "eslint-config-jquery",
+       "root": true,
+       "env": {
+               "node": true
        }
 }
index e1e7dbfe4f39df124ed8a150bf503f20ab432907..676ce17393ae7caa7b5728d7ee49fa4fadc844e9 100644 (file)
@@ -10,7 +10,7 @@
 
 npm-debug.log
 
-/dist
+/dist/jquery*
 /node_modules
 
 /test/node_smoke_tests/lib/ensure_iterability.js
diff --git a/.jshintignore b/.jshintignore
deleted file mode 100644 (file)
index bc2a1e2..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-external
-test/data/jquery-1.9.1.js
-test/data/badcall.js
-test/data/badjson.js
-test/data/json_obj.js
-test/data/readywaitasset.js
-test/data/readywaitloader.js
-test/data/support/csp.js
-test/data/support/getComputedSupport.js
-test/node_smoke_tests/lib/ensure_iterability.js
index 5f101050a59e12525856d8ae5c3d9e06e1a66c72..8f8408d838c242ab9d432fad6fd63f37df4c7a0e 100644 (file)
@@ -180,7 +180,7 @@ module.exports = function( grunt ) {
        // Integrate jQuery specific tasks
        grunt.loadTasks( "build/tasks" );
 
-       grunt.registerTask( "lint", [ "jsonlint" ] );
+       grunt.registerTask( "lint", [ "jsonlint", "eslint:all" ] );
 
        // Don't run Node-related tests in Node.js < 1.0.0 as they require an old
        // jsdom version that needs compiling, making it harder for people to compile
@@ -194,6 +194,7 @@ module.exports = function( grunt ) {
        // Short list as a high frequency watch task
        grunt.registerTask( "dev", [
                        "build:*:*",
+                       "newer:eslint:dev",
                        "uglify",
                        "remove_map_comment",
                        "dist:*"
@@ -202,5 +203,5 @@ module.exports = function( grunt ) {
 
        grunt.registerTask( "default", [ "dev", "test_fast", "compare_size" ] );
 
-       grunt.registerTask( "precommit_lint", [ "newer:jsonlint" ] );
+       grunt.registerTask( "precommit_lint", [ "newer:jsonlint", "newer:eslint:all" ] );
 };
diff --git a/build/.eslintrc b/build/.eslintrc
deleted file mode 100644 (file)
index 11368d9..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-{
-       "env": {
-               "node": true
-       },
-       "extends": "../.eslintrc",
-       "root": true
-}
index 72d6ab5a35176143fa2c74e2b89448a95ed13077..22cd90c867d036a06108c1456116cc04e1e418aa 100644 (file)
@@ -21,6 +21,7 @@ module.exports = function( Release ) {
        Release.define( {
                npmPublish: true,
                issueTracker: "github",
+
                /**
                 * Ensure the repo is in a proper state before release
                 * @param {Function} callback
@@ -28,6 +29,7 @@ module.exports = function( Release ) {
                checkRepoState: function( callback ) {
                        ensureSizzle( Release, callback );
                },
+
                /**
                 * Set the version in the src folder for distributing AMD
                 */
@@ -37,6 +39,7 @@ module.exports = function( Release ) {
                        contents = contents.replace( /@VERSION/g, Release.newVersion );
                        fs.writeFileSync( corePath, contents, "utf8" );
                },
+
                /**
                 * Generates any release artifacts that should be included in the release.
                 * The callback must be invoked with an array of files that should be
@@ -54,6 +57,7 @@ module.exports = function( Release ) {
                        Release._setSrcVersion();
                        callback( files );
                },
+
                /**
                 * Acts as insertion point for restoring Release.dir.repo
                 * It was changed to reuse npm publish code in jquery-release
@@ -65,6 +69,7 @@ module.exports = function( Release ) {
                        Release.dir.repo = Release.dir.origRepo || Release.dir.repo;
                        return npmTags();
                },
+
                /**
                 * Publish to distribution repo and npm
                 * @param {Function} callback
index ab1c993a0cc59970d84f2217a3115071b2920853..d086ae8d625bc970a6fbde2cbe8f8e0373ce4b0d 100644 (file)
@@ -38,7 +38,7 @@ module.exports = function( grunt ) {
                        // Avoid breaking semicolons inserted by r.js
                        skipSemiColonInsertion: true,
                        wrap: {
-                               start: wrapper[ 0 ].replace( /\/\*jshint .* \*\/\n/, "" ),
+                               start: wrapper[ 0 ].replace( /\/\*eslint .* \*\/\n/, "" ),
                                end: globals.replace(
                                        /\/\*\s*ExcludeStart\s*\*\/[\w\W]*?\/\*\s*ExcludeEnd\s*\*\//ig,
                                        ""
@@ -64,7 +64,12 @@ module.exports = function( grunt ) {
                // Convert var modules
                if ( /.\/var\//.test( path.replace( process.cwd(), "" ) ) ) {
                        contents = contents
-                               .replace( /define\([\w\W]*?return/, "var " + ( /var\/([\w-]+)/.exec( name )[ 1 ] ) + " =" )
+                               .replace(
+                                       /define\([\w\W]*?return/,
+                                       "var " +
+                                       ( /var\/([\w-]+)/.exec( name )[ 1 ] ) +
+                                       " ="
+                               )
                                .replace( rdefineEnd, "" );
 
                // Sizzle treatment
@@ -130,6 +135,7 @@ module.exports = function( grunt ) {
                        excluded = [],
                        included = [],
                        version = grunt.config( "pkg.version" ),
+
                        /**
                         * Recursively calls the excluder to remove on all modules in the list
                         * @param {Array} list
@@ -167,6 +173,7 @@ module.exports = function( grunt ) {
                                        } );
                                }
                        },
+
                        /**
                         * Adds the specified module to the excluded or included list, depending on the flag
                         * @param {String} flag A module path relative to
index e633755ee4d94b8d87accddcad372fe62ec50eee..34353a7836e55bc4c49720e6ead8148bc0fecf08 100644 (file)
@@ -1,5 +1,3 @@
-/* jshint node: true */
-
 "use strict";
 
 // Run Node with provided parameters: the first one being the Grunt
@@ -13,4 +11,4 @@ module.exports = function spawnTest( done ) {
                .on( "close", function( code ) {
                        done( code === 0 );
                } );
-} ;
+};
diff --git a/dist/.eslintrc b/dist/.eslintrc
new file mode 100644 (file)
index 0000000..c86665b
--- /dev/null
@@ -0,0 +1,17 @@
+{
+       "extends": "../src/.eslintrc",
+       "rules": {
+               // That is okay for built version
+               "no-multiple-empty-lines": "off",
+
+               // Because sizze is not compatible to jquery code style
+               "lines-around-comment": "off",
+               "space-in-parens": "off",
+               "camelcase": "off",
+               "computed-property-spacing": "off",
+               "max-len": "off",
+               "dot-notation": "off",
+               "semi-spacing": "off",
+               "brace-style": "off"
+       }
+}
index 00b7d2e655d3a02efc453c7273eccac7c64cbdea..5f099251c809ac3487cc30d6cfec3b609487a5d6 100644 (file)
@@ -29,6 +29,7 @@
     "commitplease": "2.3.1",
     "core-js": "2.2.2",
     "cross-spawn": "2.2.3",
+    "eslint-config-jquery": "0.1.2",
     "grunt": "1.0.1",
     "grunt-babel": "6.0.0",
     "grunt-cli": "1.2.0",
index ef090331fc0919fd9552d3be59183b96a5a3503b..dbf16c58465fbb4b0947b0ff52c297c94be2ee71 100644 (file)
@@ -1,15 +1,18 @@
 {
-  "env": {
-       "browser"
-  },
-  "extends": "../.eslintrc",
-  "root": true,
-  "globals": {
-    "window": true,
-    "JSON": false,
-    "jQuery": true,
-    "define": true,
-    "module": true,
-    "noGlobal": true
-  }
+       // Support: IE <=9 only, Android <=4.0 only
+       // The above browsers are failing a lot of tests in the ES5
+       // test suite at http://test262.ecmascript.org.
+       "parserOptions": {
+               "ecmaVersion": 3
+       },
+       "globals": {
+               "window": true,
+               "jQuery": true,
+               "define": true,
+               "module": true,
+               "noGlobal": true
+       },
+       "rules": {
+               "strict": ["error", "function"]
+       }
 }
index 2bb03883d907969f8722ce8387f8e8c767a0e358..85b08546f77b316aee000a0554d982c4b61e17b6 100644 (file)
@@ -306,6 +306,7 @@ jQuery.extend( {
                processData: true,
                async: true,
                contentType: "application/x-www-form-urlencoded; charset=UTF-8",
+
                /*
                timeout: 0,
                data: null,
index 7576806077efe1c0514dad065f0f5b376cf63c74..1ba42a5c8ae40b97fc003e8eff754600760ffa64 100644 (file)
@@ -143,11 +143,16 @@ jQuery.extend( {
 
                                while ( i-- ) {
                                        option = options[ i ];
+
+                                       /* eslint-disable no-cond-assign */
+
                                        if ( option.selected =
                                                jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1
                                        ) {
                                                optionSet = true;
                                        }
+
+                                       /* eslint-enable no-cond-assign */
                                }
 
                                // Force browsers to behave consistently when non-matching value is set
index 9dd05294e405086d97ac8c54023eab28b550985b..5bdb2169cea8c0b3a581a2997429012e14b95f13 100644 (file)
@@ -1,3 +1,7 @@
+/* global Symbol */
+// Defining this global in .eslintrc would create a danger of using the global
+// unguarded in another place, it seems safer to define global only for this module
+
 define( [
        "./var/arr",
        "./var/document",
@@ -252,7 +256,11 @@ jQuery.extend( {
        },
 
        isEmptyObject: function( obj ) {
+
+               /* eslint-disable no-unused-vars */
+               // See https://github.com/eslint/eslint/issues/6125
                var name;
+
                for ( name in obj ) {
                        return false;
                }
@@ -442,15 +450,9 @@ jQuery.extend( {
        support: support
 } );
 
-// JSHint would error on this code due to the Symbol not being defined in ES5.
-// Defining this global in .jshintrc would create a danger of using the global
-// unguarded in another place, it seems safer to just disable JSHint for these
-// three lines.
-/* jshint ignore: start */
 if ( typeof Symbol === "function" ) {
        jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
 }
-/* jshint ignore: end */
 
 // Populate the class2type map
 jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
index f1d1f00cee902ff5e228a25f755b2fb4577d459e..ded3a16667177f5b6c8508ab3ae0e9e54fddc963 100644 (file)
@@ -10,8 +10,12 @@ function adjustCSS( elem, prop, valueParts, tween ) {
                scale = 1,
                maxIterations = 20,
                currentValue = tween ?
-                       function() { return tween.cur(); } :
-                       function() { return jQuery.css( elem, prop, "" ); },
+                       function() {
+                               return tween.cur();
+                       } :
+                       function() {
+                               return jQuery.css( elem, prop, "" );
+                       },
                initial = currentValue(),
                unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
 
index 7d0fb238eb9e276502d0b253972c5675a602b132..e00f7538b3961c0a529adf0ea6ee70b72f83ad68 100644 (file)
@@ -13,7 +13,6 @@ return function( owner ) {
        //    - Node.DOCUMENT_NODE
        //  - Object
        //    - Any
-       /* jshint -W018 */
        return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
 };
 
index a7938025ca238a1b5075ac3f4b3c0c777740be08..8139515fef7ff942d1fbb170e11ca769b0fe4a47 100644 (file)
@@ -37,7 +37,7 @@ function adoptValue( value, resolve, reject ) {
        // For Promises/A+, convert exceptions into rejections
        // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in
        // Deferred#then to conditionally suppress rejection.
-       } catch ( /*jshint -W002 */ value ) {
+       } catch ( value ) {
 
                // Support: Android 4.0 only
                // Strict mode functions invoked without .call/.apply get global-object context
index 6a1fb3a28b2b6423fa65faf8624af576f6981c54..cc21cfcfa8e7cdaee56b9db14124d232fd131467 100644 (file)
@@ -51,7 +51,7 @@ function genFx( type, includeWidth ) {
        // If we include width, step value is 1 to do all cssExpand values,
        // otherwise step value is 2 to skip over Left and Right
        includeWidth = includeWidth ? 1 : 0;
-       for ( ; i < 4 ; i += 2 - includeWidth ) {
+       for ( ; i < 4; i += 2 - includeWidth ) {
                which = cssExpand[ i ];
                attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
        }
@@ -78,7 +78,6 @@ function createTween( value, prop, animation ) {
 }
 
 function defaultPrefilter( elem, props, opts ) {
-       /* jshint validthis: true */
        var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,
                isBox = "width" in props || "height" in props,
                anim = this,
@@ -220,9 +219,12 @@ function defaultPrefilter( elem, props, opts ) {
                                showHide( [ elem ], true );
                        }
 
-                       /* jshint -W083 */
+                       /* eslint-disable no-loop-func */
+
                        anim.done( function() {
 
+                       /* eslint-enable no-loop-func */
+
                                // The final step of a "hide" animation is actually hiding the element
                                if ( !hidden ) {
                                        showHide( [ elem ] );
@@ -307,7 +309,7 @@ function Animation( elem, properties, options ) {
                                index = 0,
                                length = animation.tweens.length;
 
-                       for ( ; index < length ; index++ ) {
+                       for ( ; index < length; index++ ) {
                                animation.tweens[ index ].run( percent );
                        }
 
@@ -348,7 +350,7 @@ function Animation( elem, properties, options ) {
                                        return this;
                                }
                                stopped = true;
-                               for ( ; index < length ; index++ ) {
+                               for ( ; index < length; index++ ) {
                                        animation.tweens[ index ].run( 1 );
                                }
 
@@ -366,7 +368,7 @@ function Animation( elem, properties, options ) {
 
        propFilter( props, animation.opts.specialEasing );
 
-       for ( ; index < length ; index++ ) {
+       for ( ; index < length; index++ ) {
                result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );
                if ( result ) {
                        if ( jQuery.isFunction( result.stop ) ) {
@@ -420,7 +422,7 @@ jQuery.Animation = jQuery.extend( Animation, {
                        index = 0,
                        length = props.length;
 
-               for ( ; index < length ; index++ ) {
+               for ( ; index < length; index++ ) {
                        prop = props[ index ];
                        Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];
                        Animation.tweeners[ prop ].unshift( callback );
index a50fbb6cddea25fb7a63c11a0839e2ee2f3452e5..ebdb73b3058c4f29932cd5e6982c20e67a29dd5a 100644 (file)
@@ -2,7 +2,7 @@
 
 // This file is included in a different way from all the others
 // so the "use strict" pragma is not needed.
-/* jshint strict: false */
+/* eslint strict: "off" */
 
 /* ExcludeEnd */
 
index d53eaa0214708844bc6f72bf1a844d1c0b982f5c..9b4f5e451d2d1783acd20299d398a4d1bb4f2010 100644 (file)
@@ -29,8 +29,14 @@ define( [
 "use strict";
 
 var
+
+       /* eslint-disable max-len */
+
+       // See https://github.com/eslint/eslint/issues/3229
        rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,
 
+       /* eslint-enable */
+
        // Support: IE <=10 - 11, Edge 12 - 13
        // In IE/Edge using regex groups here causes severe slowdowns.
        // See https://connect.microsoft.com/IE/feedback/details/1736512/
index e13f585ae64927d0f30a928a3d16720d982223d8..2e0c17e1534eb04c70d9093cdbbd88c2ae7cd178 100644 (file)
@@ -1 +1,3 @@
-define( [ "./selector-sizzle" ], function() {} );
+define( [ "./selector-sizzle" ], function() {
+       "use strict";
+} );
index 5428524758461895cce2bee580c0746c23f7e954..c742fb5c317a3a68b5bbdc3336578714647f66c0 100644 (file)
@@ -13,7 +13,6 @@ var risSimple = /^.[^:#\[\.,]*$/;
 function winnow( elements, qualifier, not ) {
        if ( jQuery.isFunction( qualifier ) ) {
                return jQuery.grep( elements, function( elem, i ) {
-                       /* jshint -W018 */
                        return !!qualifier.call( elem, i, elem ) !== not;
                } );
 
index 5f07c059a23bb93bf92dc0451cb2c9633310f826..d93d036d09076942ab792f06bd811f7c688c44a6 100644 (file)
@@ -1,4 +1,4 @@
-/*jshint unused:false */
+/*eslint-disable no-unused-vars*/
 /*!
  * jQuery JavaScript Library v@VERSION
  * https://jquery.com/
@@ -38,7 +38,7 @@
        }
 
 // Pass this if window is not defined yet
-}( typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
+} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
 
 // Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1
 // throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode
@@ -50,4 +50,4 @@
 // build.js inserts compiled jQuery here
 
 return jQuery;
-} ) );
+} );
index 439a07a6c514d49b259c645824796afacb6a5f8f..7887ec567d812d727a7220873b33b3dc460d85e7 100644 (file)
@@ -1,55 +1,59 @@
 {
-  "env": {
-    "browser": true
-  },
-  "extends": "../.eslintrc",
-  "root": true,
-  "globals": {
-    "require": false,
-    "define": false,
-    "DOMParser": false,
-    "JSON": false,
-    "Promise": false,
-    "Symbol": false,
-    "QUnit": false,
-    "ajaxTest": false,
-    "testIframe": false,
-    "testIframeWithCallback": false,
-    "iframeCallback": true,
-    "createDashboardXML": false,
-    "createXMLFragment": false,
-    "moduleTeardown": false,
-    "testFoo": false,
-    "url": false,
-    "t": false,
-    "q": false,
-    "jQuery": true,
-    "sinon": true,
-    "amdDefined": true,
-    "fireNative": true,
-    "Globals": true,
-    "hasPHP": true,
-    "isLocal": true,
-    "supportjQuery": true,
-    "originaljQuery": true,
-    "$": true,
-    "original$": true,
-    "baseURL": true,
-    "externalHost": true
-  },
-  "rules": {
-       // See https://github.com/eslint/eslint/issues/6125
-       "no-unused-vars": "off",
+       "env": {
+               "browser": true
+       },
+       // Support: IE <=9 only, Android <=4.0 only
+       // The above browsers are failing a lot of tests in the ES5
+       // test suite at http://test262.ecmascript.org.
+       "parserOptions": {
+               "ecmaVersion": 3
+       },
+       "globals": {
+               "require": false,
+               "define": false,
+               "DOMParser": false,
+               "JSON": false,
+               "Promise": false,
+               "Symbol": false,
+               "QUnit": false,
+               "ajaxTest": false,
+               "testIframe": false,
+               "testIframeWithCallback": false,
+               "iframeCallback": true,
+               "createDashboardXML": false,
+               "createXMLFragment": false,
+               "moduleTeardown": false,
+               "testFoo": false,
+               "url": false,
+               "t": false,
+               "q": false,
+               "jQuery": true,
+               "sinon": true,
+               "amdDefined": true,
+               "fireNative": true,
+               "Globals": true,
+               "hasPHP": true,
+               "isLocal": true,
+               "supportjQuery": true,
+               "originaljQuery": true,
+               "$": true,
+               "original$": true,
+               "baseURL": true,
+               "externalHost": true
+       },
+       "rules": {
+               // See https://github.com/eslint/eslint/issues/2342
+               "no-unused-vars": "off",
 
-       // Too much errors
-       "max-len": "off",
-       "brace-style": "off",
-       "key-spacing": "off",
-       "camelcase": "off",
-       "dot-notaion": "off",
+               // Too much errors
+               "max-len": "off",
+               "brace-style": "off",
+               "key-spacing": "off",
+               "camelcase": "off",
+               "dot-notaion": "off",
 
-       // Not a lot really too much, but waiting for autofix for these rules
-       "lines-around-comment": "off",
-       "dot-notation": "off"
-  }
+               // Not really too much - waiting autofix features for these rules
+               "lines-around-comment": "off",
+               "dot-notation": "off"
+       }
 }
index 40ac0211435573748a285689bed925a2ac632c00..9e2679654dba9dbf75cf26a06f9dedb68d280fa7 100644 (file)
@@ -1,7 +1,6 @@
-/*jshint multistr:true, quotmark:false */
+/* eslint no-multi-str: "off" */
 
-var fireNative, originaljQuery, original$,
-       baseURL = "",
+var baseURL = "",
        supportjQuery = this.jQuery,
 
        // see RFC 2606
@@ -12,8 +11,8 @@ this.isLocal = window.location.protocol === "file:";
 
 // Setup global variables before loading jQuery for testing .noConflict()
 supportjQuery.noConflict( true );
-originaljQuery = this.jQuery = undefined;
-original$ = this.$ = "replaced";
+window.originaljQuery = this.jQuery = undefined;
+window.original$ = this.$ = "replaced";
 
 /**
  * Returns an array of elements with the given IDs
@@ -44,7 +43,7 @@ function match( message, selector, expectedIds, context ) {
                i = 0;
 
        for ( ; i < f.length; i++ ) {
-               s += ( s && "," ) + '"' + f[ i ].id + '"';
+               s += ( s && "," ) + "\"" + f[ i ].id + "\"";
        }
 
        this.deepEqual( f, q.apply( q, expectedIds ), message + " (" + selector + ")" );
@@ -75,38 +74,38 @@ QUnit.assert.selectInFixture = function( message, selector, expectedIds ) {
 };
 
 this.createDashboardXML = function() {
-       var string = '<?xml version="1.0" encoding="UTF-8"?> \
+       var string = "<?xml version='1.0' encoding='UTF-8'?> \
        <dashboard> \
-               <locations class="foo"> \
-                       <location for="bar" checked="different"> \
-                               <infowindowtab normal="ab" mixedCase="yes"> \
-                                       <tab title="Location"><![CDATA[blabla]]></tab> \
-                                       <tab title="Users"><![CDATA[blublu]]></tab> \
+               <locations class='foo'> \
+                       <location for='bar' checked='different'> \
+                               <infowindowtab normal='ab' mixedCase='yes'> \
+                                       <tab title='Location'><![CDATA[blabla]]></tab> \
+                                       <tab title='Users'><![CDATA[blublu]]></tab> \
                                </infowindowtab> \
                        </location> \
                </locations> \
-       </dashboard>';
+       </dashboard>";
 
        return jQuery.parseXML( string );
 };
 
 this.createWithFriesXML = function() {
-       var string = '<?xml version="1.0" encoding="UTF-8"?> \
-       <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" \
-               xmlns:xsd="http://www.w3.org/2001/XMLSchema" \
-               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> \
+       var string = "<?xml version='1.0' encoding='UTF-8'?> \
+       <soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' \
+               xmlns:xsd='http://www.w3.org/2001/XMLSchema' \
+               xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'> \
                <soap:Body> \
-                       <jsconf xmlns="http://{{ externalHost }}/ns1"> \
-                               <response xmlns:ab="http://{{ externalHost }}/ns2"> \
+                       <jsconf xmlns='http://{{ externalHost }}/ns1'> \
+                               <response xmlns:ab='http://{{ externalHost }}/ns2'> \
                                        <meta> \
-                                               <component id="seite1" class="component"> \
-                                                       <properties xmlns:cd="http://{{ externalHost }}/ns3"> \
-                                                               <property name="prop1"> \
+                                               <component id='seite1' class='component'> \
+                                                       <properties xmlns:cd='http://{{ externalHost }}/ns3'> \
+                                                               <property name='prop1'> \
                                                                        <thing /> \
                                                                        <value>1</value> \
                                                                </property> \
-                                                               <property name="prop2"> \
-                                                                       <thing att="something" /> \
+                                                               <property name='prop2'> \
+                                                                       <thing att='something' /> \
                                                                </property> \
                                                                <foo_bar>foo</foo_bar> \
                                                        </properties> \
@@ -115,7 +114,7 @@ this.createWithFriesXML = function() {
                                </response> \
                        </jsconf> \
                </soap:Body> \
-       </soap:Envelope>';
+       </soap:Envelope>";
 
        return jQuery.parseXML( string.replace( /\{\{\s*externalHost\s*\}\}/g, externalHost ) );
 };
@@ -123,7 +122,7 @@ this.createWithFriesXML = function() {
 this.createXMLFragment = function() {
        var xml, frag;
        if ( window.ActiveXObject ) {
-               xml = new ActiveXObject( "msxml2.domdocument" );
+               xml = new window.ActiveXObject( "msxml2.domdocument" );
        } else {
                xml = document.implementation.createDocument( "", "", null );
        }
@@ -135,7 +134,7 @@ this.createXMLFragment = function() {
        return frag;
 };
 
-fireNative = document.createEvent ?
+window.fireNative = document.createEvent ?
        function( node, type ) {
                var event = document.createEvent( "HTMLEvents" );
 
@@ -263,8 +262,8 @@ QUnit.config.autostart = false;
 this.loadTests = function() {
 
        // Leverage QUnit URL parsing to detect testSwarm environment and "basic" testing mode
-       QUnit.isSwarm = ( QUnit.urlParams[ "swarmURL" ] + "" ).indexOf( "http" ) === 0;
-       QUnit.basicTests = ( QUnit.urlParams[ "module" ] + "" ) === "basic";
+       QUnit.isSwarm = ( QUnit.urlParams.swarmURL + "" ).indexOf( "http" ) === 0;
+       QUnit.basicTests = ( QUnit.urlParams.module + "" ) === "basic";
 
        // Get testSubproject from testrunner first
        require( [ "data/testrunner.js" ], function() {
index 282933c1ae2ef37cf2773ae3c5453398efa1878b..0d1d554d18607327f462224dc78232cf896d5a6f 100644 (file)
@@ -1,10 +1,7 @@
 {
        "env": {
-               "node": true
+               "es6": true
        },
-       "parserOptions": {
-               "ecmaVersion": 6
-       },
-       "extends": "../.eslintrc",
+       "extends" : "../../.eslintrc",
        "root": true
 }
index dd377f19c25509c099145e669f299c1bc58180e2..34701d691ca3bd52eb978fcf7c397e74be50e196 100644 (file)
@@ -1,5 +1,3 @@
-/* jshint esnext: true */
-
 "use strict";
 
 var assert = require( "assert" );
index ebe68539e1b61e8eff8ad79436bf722d7ad753ed..8e2396d232b727f42462a76db6687ba81e580053 100644 (file)
@@ -1,5 +1,3 @@
-/* jshint esnext: true */
-
 "use strict";
 
 var assert = require( "assert" );
index 11368d984c18300f554632604a44edceec3127e5..7acfff35a88a9a9dbb195fb33f710b3611645c53 100644 (file)
@@ -1,7 +1,4 @@
 {
-       "env": {
-               "node": true
-       },
-       "extends": "../.eslintrc",
+       "extends": "../../.eslintrc",
        "root": true
 }
index 1a4ff7ee4df51b337e5bd1fdd4f9dbdb84983c70..5e24c3049d0625db19d0e510a952bbf1b2b1a91d 100644 (file)
@@ -99,7 +99,7 @@ QUnit.module( "ajax", {
                                assert.ok( true, "success" );
                        },
                        fail: function() {
-                               if (jQuery.support.cors === false) {
+                               if ( jQuery.support.cors === false ) {
                                        assert.ok( true, "fail" );
                                }
                        },
@@ -1737,11 +1737,11 @@ if ( typeof window.ArrayBuffer === "undefined" || typeof new XMLHttpRequest().re
 } else {
 
        // No built-in support for binary data, but it's easy to add via a prefilter
-       jQuery.ajaxPrefilter( "arraybuffer", function ( s ) {
+       jQuery.ajaxPrefilter( "arraybuffer", function( s ) {
                s.xhrFields = { responseType: "arraybuffer" };
                s.responseFields.arraybuffer = "response";
                s.converters[ "binary arraybuffer" ] = true;
-       });
+       } );
 
        ajaxTest( "gh-2498 - jQuery.ajax() - binary data shouldn't throw an exception", 2, function( assert ) {
                return {
@@ -1961,7 +1961,7 @@ if ( typeof window.ArrayBuffer === "undefined" || typeof new XMLHttpRequest().re
                        url: url( "data/ajax/content-type.php" ),
                        data: {
                                "content-type": "test/jsontest",
-                               "response": JSON.stringify({test: "test"})
+                               "response": JSON.stringify( { test: "test" } )
                        },
                        success: function( result ) {
                                assert.strictEqual(
index 127eb3e1e5f608b8204552e80ecc48fc4201f03e..771d31cb870040d060cca4c1e44502fc4169a8b3 100644 (file)
@@ -758,9 +758,9 @@ QUnit.test( "prop('tabindex')", function( assert ) {
 
 QUnit.test( "image.prop( 'tabIndex' )", function( assert ) {
        assert.expect( 1 );
-       var image = jQuery("<img src='data/1x1.jpg' />")
-               .appendTo("#qunit-fixture");
-       assert.equal( image.prop("tabIndex" ), -1, "tabIndex on image" );
+       var image = jQuery( "<img src='data/1x1.jpg' />" )
+               .appendTo( "#qunit-fixture" );
+       assert.equal( image.prop( "tabIndex" ), -1, "tabIndex on image" );
 } );
 
 QUnit.test( "prop('tabindex', value)", function( assert ) {
@@ -1653,7 +1653,7 @@ QUnit.test( "non-lowercase boolean attribute getters should not crash", function
                required: "requiRed",
                autofocus: "AUTOFOCUS"
        }, function( lowercased, original ) {
-           try {
+               try {
                        assert.strictEqual( elem.attr( original ), lowercased,
                                "The '" + this + "' attribute getter should return the lowercased name" );
                } catch ( e ) {
index 57c8dd9e995c2807beff3c718a219fafa8fe884c..8ad3c86ce238f70a0ea9c9937a746a93e2e4492f 100644 (file)
@@ -95,7 +95,7 @@ QUnit.test( "jQuery()", function( assert ) {
        assert.equal( div.length, 4, "Correct number of elements generated for div hr code b" );
        assert.equal( div.parent().length, 0, "Make sure that the generated HTML has no parent." );
 
-       assert.equal( jQuery( [ 1,2,3 ] ).get( 1 ), 2, "Test passing an array to the factory" );
+       assert.equal( jQuery( [ 1, 2, 3 ] ).get( 1 ), 2, "Test passing an array to the factory" );
 
        assert.equal( jQuery( document.body ).get( 0 ), jQuery( "body" ).get( 0 ), "Test passing an html node to the factory" );
 
@@ -274,7 +274,7 @@ QUnit.test( "type", function( assert ) {
 
 QUnit.test( "type for `Symbol`", function( assert ) {
        // Prevent reference errors
-       if( typeof Symbol !== "function" ) {
+       if ( typeof Symbol !== "function" ) {
                assert.expect( 0 );
                return;
        }
@@ -283,7 +283,7 @@ QUnit.test( "type for `Symbol`", function( assert ) {
 
        assert.equal( jQuery.type( Symbol() ), "symbol", "Symbol" );
        assert.equal( jQuery.type( Object( Symbol() ) ), "symbol", "Symbol" );
-});
+} );
 
 QUnit.asyncTest( "isPlainObject", function( assert ) {
 
@@ -968,7 +968,7 @@ QUnit.test( "jQuery.map", function( assert ) {
        assert.ok( !result, "empty NodeList treated like array" );
 
        result = jQuery.map( Array( 4 ), function( v, k ) {
-               return k % 2 ? k : [ k,k,k ];
+               return k % 2 ? k : [ k, k, k ];
        } );
        assert.equal( result.join( "" ), "00012223", "Array results flattened (#2616)" );
 } );
@@ -1120,7 +1120,7 @@ QUnit.test( "jQuery.grep(Array-like)", function( assert ) {
                [],
                "Satisfying elements absent, Array-like object used, and grep explicitly uninverted"
        );
-});
+} );
 
 QUnit.test( "jQuery.extend(Object, Object)", function( assert ) {
        assert.expect( 28 );
@@ -1238,19 +1238,19 @@ QUnit.test( "jQuery.extend(Object, Object)", function( assert ) {
 QUnit.test( "jQuery.extend(Object, Object {created with \"defineProperties\"})", function( assert ) {
        assert.expect( 2 );
 
-       var definedObj = Object.defineProperties({}, {
+       var definedObj = Object.defineProperties( {}, {
         "enumerableProp": {
-          get: function () {
+          get: function() {
             return true;
           },
           enumerable: true
         },
         "nonenumerableProp": {
-          get: function () {
+          get: function() {
             return true;
           }
         }
-      }),
+      } ),
       accessorObj = {};
 
        jQuery.extend( accessorObj, definedObj );
@@ -1308,7 +1308,7 @@ QUnit.test( "jQuery.each(Object,Function)", function( assert ) {
        assert.deepEqual( seen, [ 1, 2 ], "Broken array iteration" );
 
        seen = [];
-       jQuery.each( { "a": 1, "b": 2,"c": 3 }, function( k, v ) {
+       jQuery.each( { "a": 1, "b": 2, "c": 3 }, function( k, v ) {
                seen.push( v );
                return false;
        } );
@@ -1428,7 +1428,7 @@ QUnit.test( "jQuery.makeArray", function( assert ) {
 
        assert.equal( ( function() { return jQuery.makeArray( arguments ); } )( 1, 2 ).join( "" ), "12", "Pass makeArray an arguments array" );
 
-       assert.equal( jQuery.makeArray( [ 1,2,3 ] ).join( "" ), "123", "Pass makeArray a real array" );
+       assert.equal( jQuery.makeArray( [ 1, 2, 3 ] ).join( "" ), "123", "Pass makeArray a real array" );
 
        assert.equal( jQuery.makeArray().length, 0, "Pass nothing to makeArray and expect an empty array" );
 
@@ -1692,7 +1692,6 @@ testIframe(
 );
 
 QUnit.test( "Iterability of jQuery objects (gh-1693)", function( assert ) {
-       /* jshint unused: false */
        assert.expect( 1 );
 
        var i, elem, result;
index 38d5ed6d15a5b8eeeff7a84cf92caafaa7ccb98d..ad8b808ffe0501f8de52ad955e6cb4809f5ac56d 100644 (file)
@@ -141,7 +141,7 @@ QUnit.test( "css() explicit and relative values", function( assert ) {
        $elem.css( "width", "+=9" );
        assert.equal( $elem.css( "width" ), "10px", "'+=9' on width (params)" );
 
-       $elem.css( "width", "-=9" ) ;
+       $elem.css( "width", "-=9" );
        assert.equal( $elem.css( "width" ), "1px", "'-=9' on width (params)" );
 
        $elem.css( "width", "+=9px" );
@@ -354,8 +354,8 @@ QUnit.test( "css(String, Function)", function( assert ) {
                sizes = [ "10px", "20px", "30px" ];
 
        jQuery( "<div id='cssFunctionTest'><div class='cssFunction'></div>" +
-                                "<div class='cssFunction'></div>" +
-                                "<div class='cssFunction'></div></div>" )
+                               "<div class='cssFunction'></div>" +
+                               "<div class='cssFunction'></div></div>" )
                .appendTo( "body" );
 
        index = 0;
@@ -385,8 +385,8 @@ QUnit.test( "css(String, Function) with incoming value", function( assert ) {
                sizes = [ "10px", "20px", "30px" ];
 
        jQuery( "<div id='cssFunctionTest'><div class='cssFunction'></div>" +
-                                "<div class='cssFunction'></div>" +
-                                "<div class='cssFunction'></div></div>" )
+                               "<div class='cssFunction'></div>" +
+                               "<div class='cssFunction'></div></div>" )
                .appendTo( "body" );
 
        index = 0;
@@ -416,8 +416,8 @@ QUnit.test( "css(Object) where values are Functions", function( assert ) {
                sizes = [ "10px", "20px", "30px" ];
 
        jQuery( "<div id='cssFunctionTest'><div class='cssFunction'></div>" +
-                                "<div class='cssFunction'></div>" +
-                                "<div class='cssFunction'></div></div>" )
+                               "<div class='cssFunction'></div>" +
+                               "<div class='cssFunction'></div></div>" )
                .appendTo( "body" );
 
        index = 0;
@@ -447,8 +447,8 @@ QUnit.test( "css(Object) where values are Functions with incoming values", funct
                sizes = [ "10px", "20px", "30px" ];
 
        jQuery( "<div id='cssFunctionTest'><div class='cssFunction'></div>" +
-                                "<div class='cssFunction'></div>" +
-                                "<div class='cssFunction'></div></div>" )
+                               "<div class='cssFunction'></div>" +
+                               "<div class='cssFunction'></div></div>" )
                .appendTo( "body" );
 
        index = 0;
@@ -988,18 +988,18 @@ QUnit.test( "computed margins (trac-3333; gh-2237)", function( assert ) {
        assert.equal( $div.css( "marginRight" ), "0px",
                "marginRight correctly calculated with a width and display block" );
 
-       $div.css({
+       $div.css( {
                position: "absolute",
                top: 0,
                left: 0,
                width: "100px"
-       });
-       $child.css({
+       } );
+       $child.css( {
                width: "50px",
                margin: "auto"
-       });
+       } );
        assert.equal( $child.css( "marginLeft" ), "25px", "auto margins are computed to pixels" );
-});
+} );
 
 QUnit.test( "box model properties incorrectly returning % instead of px, see #10639 and #12088", function( assert ) {
        assert.expect( 2 );
@@ -1309,7 +1309,7 @@ QUnit[ jQuery.find.compile ? "test" : "skip" ]( ":visible/:hidden selectors", fu
 
        assert.t( "Is Visible", "#qunit-fixture div:visible:lt(2)", [ "foo", "nothiddendiv" ] );
        assert.t( "Is Not Hidden", "#qunit-fixture:hidden", [] );
-       assert.t( "Is Hidden", "#form input:hidden", [ "hidden1","hidden2" ] );
+       assert.t( "Is Hidden", "#form input:hidden", [ "hidden1", "hidden2" ] );
 
        $a = jQuery( "<a href='#'><h1>Header</h1></a>" ).appendTo( "#qunit-fixture" );
        assert.ok( $a.is( ":visible" ), "Anchor tag with flow content is visible (gh-2227)" );
@@ -1345,7 +1345,7 @@ QUnit.test(
                                name: "backgroundAttachment",
                                value: [ "fixed" ],
                                expected: [ "scroll" ]
-                       },{
+                       }, {
                                name: "backgroundColor",
                                value: [ "rgb(255, 0, 0)", "rgb(255,0,0)", "#ff0000" ],
                                expected: [ "transparent" ]
index 9a9371aae3eaf650f58f0c0fe39a2f58d26fed82..0eb1d5149163a97d9dcdea4ac09dafc81c4072e9 100644 (file)
@@ -409,7 +409,7 @@ QUnit.test( "data-* attributes", function( assert ) {
                        break;
                case 3:
                        assert.equal( jQuery( elem ).data( "number" ), true, "Check number property" );
-                       assert.deepEqual( jQuery( elem ).data( "stuff" ), [ 2,8 ], "Check stuff property" );
+                       assert.deepEqual( jQuery( elem ).data( "stuff" ), [ 2, 8 ], "Check stuff property" );
                        break;
                default:
                        assert.ok( false, [ "Assertion failed on index ", index, ", with data" ].join( "" ) );
@@ -881,13 +881,13 @@ QUnit.test( "Check that the expando is removed when there's no more data", funct
                        assert.strictEqual( div[ 0 ][ key ], undefined, "Expando was not removed when there was no more data" );
                }
        }
-});
+} );
 
 QUnit.test( "Check that the expando is removed when there's no more data on non-nodes", function( assert ) {
        assert.expect( 1 );
 
        var key,
-               obj = jQuery( {key: 42} );
+               obj = jQuery( { key: 42 } );
        obj.data( "some", "data" );
        assert.equal( obj.data( "some" ), "data", "Data is added" );
        obj.removeData( "some" );
index 3e147a96ee8d8b7d794b079817829463cc492788..32f3256814e4399f6b664d8198c02192483c738f 100644 (file)
@@ -776,8 +776,8 @@ QUnit.test( "jQuery.Deferred - resolved to a notifying deferred", function( asse
                done = assert.async( 2 );
 
        deferred.resolve( jQuery.Deferred( function( notifyingDeferred ) {
-           notifyingDeferred.notify( "foo", "bar" );
-           notifyingDeferred.resolve( "baz", "quux" );
+               notifyingDeferred.notify( "foo", "bar" );
+               notifyingDeferred.resolve( "baz", "quux" );
        } ) );
 
        // Apply an empty then to force thenable unwrapping.
@@ -808,7 +808,7 @@ QUnit.test( "jQuery.when(nonThenable) - like Promise.resolve", function( assert
 
                // Support: Android 4.0 only
                // Strict mode functions invoked without .call/.apply get global-object context
-               defaultContext = (function getDefaultContext() { return this; }).call(),
+               defaultContext = ( function getDefaultContext() { return this; } ).call(),
 
                done = assert.async( 20 );
 
@@ -915,7 +915,7 @@ QUnit.test( "jQuery.when(thenable) - like Promise.resolve", function( assert ) {
 
                // Support: Android 4.0 only
                // Strict mode functions invoked without .call/.apply get global-object context
-               defaultContext = (function getDefaultContext() { return this; }).call(),
+               defaultContext = ( function getDefaultContext() { return this; } ).call(),
 
                done = assert.async( CASES * 2 );
 
@@ -995,7 +995,7 @@ QUnit.test( "jQuery.when(a, b) - like Promise.all", function( assert ) {
 
                // Support: Android 4.0 only
                // Strict mode functions invoked without .call/.apply get global-object context
-               defaultContext = (function getDefaultContext() { return this; }).call(),
+               defaultContext = ( function getDefaultContext() { return this; } ).call(),
 
                done = assert.async( 98 );
 
index e559db82f223d0318348e0dc3eae3e8768776d4e..27ba1cf882a5ee6f2b4b91a76d5e71256fdddb18 100644 (file)
@@ -14,7 +14,7 @@ QUnit.test( "bind/unbind", function( assert ) {
                        assert.equal( e.type, "click", "correct event type" );
                        assert.equal( e.data.bindData, 19, "correct trigger data" );
                        assert.equal( trig, 42, "correct bind data" );
-                       assert.equal( e.target.nodeName.toLowerCase(), "b" , "correct element" );
+                       assert.equal( e.target.nodeName.toLowerCase(), "b", "correct element" );
                } )
                .trigger( "click", [ 42 ] )
                .unbind( "click" )
@@ -32,7 +32,7 @@ QUnit.test( "delegate/undelegate", function( assert ) {
        markup
                .delegate( "b", "click", function( e ) {
                        assert.equal( e.type, "click", "correct event type" );
-                       assert.equal( e.target.nodeName.toLowerCase(), "b" , "correct element" );
+                       assert.equal( e.target.nodeName.toLowerCase(), "b", "correct element" );
                } )
                .find( "b" )
                        .trigger( "click" )
index 8d304c435bdf0dc540d0befe4d14c56053295e08..5741b2af7a0b0885c95acf0bd493c4e320903490 100644 (file)
@@ -408,7 +408,7 @@ QUnit.test( "passing undefined is a setter #5571", function( assert ) {
 QUnit.test( "setters with and without box-sizing:border-box", function( assert ) {
        assert.expect( 120 );
 
-       var parent = jQuery( "#foo" ).css({ width: "200px", height: "200px", "font-size": "16px" }),
+       var parent = jQuery( "#foo" ).css( { width: "200px", height: "200px", "font-size": "16px" } ),
                el_bb = jQuery( "<div style='margin:5px;padding:1px;border:2px solid black;box-sizing:border-box;'></div>" ).appendTo( parent ),
                el = jQuery( "<div style='margin:5px;padding:1px;border:2px solid black;'></div>" ).appendTo( parent ),
                el_bb_np = jQuery( "<div style='margin:5px; padding:0px; border:0px solid green;box-sizing:border-box;'></div>" ).appendTo( parent ),
@@ -520,9 +520,9 @@ QUnit.test( "outside view position (gh-2836)", function( assert ) {
        parent.one( "scroll", function() {
                var pos = parent.find( "div" ).eq( 3 ).position();
 
-               assert.strictEqual(pos.top, -100);
+               assert.strictEqual( pos.top, -100 );
                stop();
-       });
+       } );
 
        parent.scrollTop( 400 );
 } );
index 2b953cd3528829f75ff215ab3f645f2d6b0b0ae8..eafe4b116eea4fd65de1621101d45fef914f05a2 100644 (file)
@@ -538,7 +538,7 @@ QUnit.test( "animate duration 0", function( assert ) {
        assert.expect( 11 );
 
        var $elem,
-               $elems = jQuery( [ { a:0 },{ a:0 } ] ),
+               $elems = jQuery( [ { a:0 }, { a:0 } ] ),
                counter = 0;
 
        assert.equal( jQuery.timers.length, 0, "Make sure no animation was running from another test" );
@@ -1845,7 +1845,7 @@ QUnit.test( "non-px animation handles non-numeric start (#11971)", function( ass
        this.clock.tick( 10 );
 } );
 
-QUnit.test("Animation callbacks (#11797)", function( assert ) {
+QUnit.test( "Animation callbacks (#11797)", function( assert ) {
        assert.expect( 16 );
 
        var prog = 0,
@@ -1966,7 +1966,7 @@ QUnit.test( "Animation callbacks in order (#2292)", function( assert ) {
                always: function() {
                        assert.step( 5 );
                }
-       }).finish();
+       } ).finish();
 
        this.clock.tick( dur + 10 );
 } );
index fef3b173ec47c0d2cc412657da50f141042ed646..02aad5e361c14b436dffef15437b8729c3fbd0e0 100644 (file)
@@ -21,10 +21,10 @@ QUnit.test( "null or undefined handler", function( assert ) {
 
        var expectedElem = jQuery( "#firstp" );
        var actualElem = expectedElem.on( "click", null );
-       assert.equal(actualElem, expectedElem, "Passing a null handler should return the original element");
+       assert.equal( actualElem, expectedElem, "Passing a null handler should return the original element" );
 
        actualElem = expectedElem.on( "click", undefined );
-       assert.equal(actualElem, expectedElem, "Passing a null handler should return the original element");
+       assert.equal( actualElem, expectedElem, "Passing a null handler should return the original element" );
 } );
 
 QUnit.test( "on() with non-null,defined data", function( assert ) {
@@ -78,7 +78,7 @@ QUnit.test( "on(), with data", function( assert ) {
 
        handler = function( event ) {
                assert.ok( event.data, "on() with data, check passed data exists" );
-               assert.equal( event.data[ "foo" ], "bar", "on() with data, Check value of passed data" );
+               assert.equal( event.data.foo, "bar", "on() with data, Check value of passed data" );
        };
        jQuery( "#firstp" ).on( "click", { "foo": "bar" }, handler ).trigger( "click" ).off( "click", handler );
 
@@ -95,7 +95,7 @@ QUnit.test( "click(), with data", function( assert ) {
        assert.expect( 3 );
        var handler = function( event ) {
                assert.ok( event.data, "on() with data, check passed data exists" );
-               assert.equal( event.data[ "foo" ], "bar", "on() with data, Check value of passed data" );
+               assert.equal( event.data.foo, "bar", "on() with data, Check value of passed data" );
        };
        jQuery( "#firstp" ).on( "click", { "foo": "bar" }, handler ).trigger( "click" ).off( "click", handler );
 
@@ -199,7 +199,7 @@ QUnit.test( "on(), namespace with special add", function( assert ) {
                        assert.ok( true, "Test event fired." );
                } );
 
-       jQuery.event.special[ "test" ] = {
+       jQuery.event.special.test = {
                _default: function( e, data ) {
                        assert.equal( e.type, "test", "Make sure we're dealing with a test event." );
                        assert.ok( data, "And that trigger data was passed." );
@@ -251,7 +251,7 @@ QUnit.test( "on(), namespace with special add", function( assert ) {
        // Should trigger 2
        div.appendTo( "#qunit-fixture" ).remove();
 
-       delete jQuery.event.special[ "test" ];
+       delete jQuery.event.special.test;
 } );
 
 QUnit.test( "on(), no data", function( assert ) {
@@ -726,8 +726,8 @@ QUnit.test( "on()/trigger()/off() on plain object", function( assert ) {
        events = jQuery._data( obj, "events" );
        assert.ok( events, "Object has events bound." );
        assert.equal( obj[ "events" ], undefined, "Events object on plain objects is not events" );
-       assert.equal( obj[ "test" ], undefined, "Make sure that test event is not on the plain object." );
-       assert.equal( obj[ "handle" ], undefined, "Make sure that the event handler is not on the plain object." );
+       assert.equal( obj.test, undefined, "Make sure that test event is not on the plain object." );
+       assert.equal( obj.handle, undefined, "Make sure that the event handler is not on the plain object." );
 
        // Should trigger 1
        jQuery( obj ).trigger( "test" );
@@ -1192,7 +1192,7 @@ QUnit.test( "trigger(eventObject, [data], [fn])", function( assert ) {
        //$child.on("foo", error );
 
        event = new jQuery.Event( "foo" );
-       $child.trigger( event, [ 1,2,3 ] ).off();
+       $child.trigger( event, [ 1, 2, 3 ] ).off();
        assert.equal( event.result, "result", "Check event.result attribute" );
 
        // Will error if it bubbles
@@ -1601,7 +1601,7 @@ QUnit.test( ".on()/.off()", function( assert ) {
 
        // Test binding with different this object
        jQuery( "#body" ).on( "click", "#foo", jQuery.proxy( function() {
-               assert.equal( this[ "foo" ], "bar", "on with event scope" ); }, { "foo": "bar" }
+               assert.equal( this.foo, "bar", "on with event scope" ); }, { "foo": "bar" }
        ) );
        jQuery( "#foo" ).trigger( "click" );
        jQuery( "#body" ).off( "click", "#foo" );
@@ -1860,7 +1860,7 @@ QUnit.test( "ignore comment nodes in event delegation (gh-2055)", function( asse
                        .appendTo( $foo.find( "#sap" ) );
 
        if ( !test() ) {
-               fireNative( $comment[0], "DOMNodeInserted" );
+               fireNative( $comment[ 0 ], "DOMNodeInserted" );
        }
 } );
 
@@ -2234,7 +2234,7 @@ QUnit.test( ".on and .off", function( assert ) {
 QUnit.test( "special on name mapping", function( assert ) {
        assert.expect( 7 );
 
-       jQuery.event.special[ "slap" ] = {
+       jQuery.event.special.slap = {
                bindType: "click",
                delegateType: "swing",
                handle: function( event ) {
@@ -2265,9 +2265,9 @@ QUnit.test( "special on name mapping", function( assert ) {
                        .trigger( "swing" )
                .end()
                .remove();
-       delete jQuery.event.special[ "slap" ];
+       delete jQuery.event.special.slap;
 
-       jQuery.event.special[ "gutfeeling" ] = {
+       jQuery.event.special.gutfeeling = {
                bindType: "click",
                delegateType: "click",
                handle: function( event ) {
@@ -2356,9 +2356,9 @@ QUnit.test( "clone() delegated events (#11076)", function( assert ) {
                clone = table.clone( true );
 
        clone.find( "td" ).trigger( "click" );
-       assert.equal( counter[ "center" ], 1, "first child" );
-       assert.equal( counter[ "fold" ], 1, "last child" );
-       assert.equal( counter[ "centerfold" ], 2, "all children" );
+       assert.equal( counter.center, 1, "first child" );
+       assert.equal( counter.fold, 1, "last child" );
+       assert.equal( counter.centerfold, 2, "all children" );
 
        table.remove();
        clone.remove();
@@ -2576,7 +2576,7 @@ QUnit.test( "change handler should be detached from element", function( assert )
                        originRemoveEvent( elem, type, handle );
                };
 
-       jQuery.removeEvent = wrapperRemoveEvent ;
+       jQuery.removeEvent = wrapperRemoveEvent;
 
        $fixture.on( "change", function() {} );
        $fixture.off( "change" );
@@ -2899,9 +2899,10 @@ QUnit.test( "originalEvent property for Chrome, Safari, Fx & Edge of simulated e
                .on( "focusin", function( event ) {
                        assert.ok( true, "focusin bubbled to outer div" );
                        assert.equal( event.originalEvent.type, "focus",
-                                    "make sure originalEvent type is correct" );
+                               "make sure originalEvent type is correct" );
                        assert.equal( event.type, "focusin", "make sure type is correct" );
                } );
+
        jQuery( "#donor-input" ).on( "focus", function() {
                assert.ok( true, "got a focus event from the input" );
                done();
index 8f8d784330294b959d56edebf04d19aa035da90a..b8fdb8e79c583763243a7e8d8cf4ffac0801cc67 100644 (file)
@@ -609,7 +609,7 @@ QUnit.test( "append(xml)", function( assert ) {
                        // IE
                        for ( n = 0, len = aActiveX.length; n < len; n++ ) {
                                try {
-                                       elem = new ActiveXObject( aActiveX[ n ] );
+                                       elem = new window.ActiveXObject( aActiveX[ n ] );
                                        return elem;
                                } catch ( _ ) {}
                        }
@@ -1175,7 +1175,7 @@ QUnit.test( ".after(disconnected node)", function( assert ) {
 
 QUnit.test( "insertAfter(String)", function( assert ) {
 
-       assert.expect( 1 ) ;
+       assert.expect( 1 );
 
        var expected = "This is a normal link: Yahoobuga";
        jQuery( "<b>buga</b>" ).insertAfter( "#yahoo" );
@@ -1211,7 +1211,7 @@ QUnit.test( "insertAfter(jQuery)", function( assert ) {
 
 function testReplaceWith( val, assert ) {
 
-       var tmp, y, child, child2, set, non_existent, $div,
+       var tmp, y, child, child2, set, nonExistent, $div,
                expected = 29;
 
        assert.expect( expected );
@@ -1295,8 +1295,8 @@ function testReplaceWith( val, assert ) {
        assert.deepEqual( jQuery( ".pathological", "#qunit-fixture" ).get(), [],
                "Replacement with following sibling (context removed)" );
 
-       non_existent = jQuery( "#does-not-exist" ).replaceWith( val( "<b>should not throw an error</b>" ) );
-       assert.equal( non_existent.length, 0, "Length of non existent element." );
+       nonExistent = jQuery( "#does-not-exist" ).replaceWith( val( "<b>should not throw an error</b>" ) );
+       assert.equal( nonExistent.length, 0, "Length of non existent element." );
 
        $div = jQuery( "<div class='replacewith'></div>" ).appendTo( "#qunit-fixture" );
        $div.replaceWith( val( "<div class='replacewith'></div><script>" +
@@ -1623,7 +1623,7 @@ QUnit.test( "clone(multiple selected options) (Bug #8129)", function( assert ) {
        var element = jQuery( "<select><option>Foo</option><option selected>Bar</option><option selected>Baz</option></select>" );
 
        function getSelectedOptions( collection ) {
-               return collection.find( "option" ).filter(function( option ) {
+               return collection.find( "option" ).filter( function( option ) {
                        return option.selected;
                } );
        }
@@ -2464,7 +2464,7 @@ QUnit.test( "script evaluation (#11795)", function( assert ) {
        if ( jQuery.ajax ) {
                Globals.register( "testBar" );
                jQuery( "#qunit-fixture" ).append( "<script src='" + url( "data/testbar.php" ) + "'/>" );
-               assert.strictEqual( window[ "testBar" ], "bar", "Global script evaluation" );
+               assert.strictEqual( window.testBar, "bar", "Global script evaluation" );
        } else {
                assert.ok( true, "No jQuery.ajax" );
                assert.ok( true, "No jQuery.ajax" );
@@ -2745,8 +2745,8 @@ QUnit.test( "Insert script with data-URI (gh-1887)", 1, function( assert ) {
        jQuery( fixture ).append( "<script src=\"data:text/javascript,testFoo = 'foo';\"></script>" );
 
        setTimeout( function() {
-               if ( window[ "testSrcFoo" ] === "foo" ) {
-                       assert.strictEqual( window[ "testFoo" ], window[ "testSrcFoo" ], "data-URI script executed" );
+               if ( window.testSrcFoo === "foo" ) {
+                       assert.strictEqual( window.testFoo, window.testSrcFoo, "data-URI script executed" );
 
                } else {
                        assert.ok( true, "data-URI script is not supported by this environment" );
index 4caf36873e20af91b20af2285183d761aeee2eac..c0df5f1ca58fb1fbb3ea603089b071aef4fcd2d2 100644 (file)
@@ -79,8 +79,8 @@ testIframe( "absolute", "offset/absolute.html", function( assert, $, iframe ) {
                { "id": "#absolute-1", "top": 1, "left": 1 }
        ];
        jQuery.each( tests, function() {
-               assert.equal( jQuery( this[ "id" ], doc ).offset().top,  this[ "top" ],  "jQuery('" + this[ "id" ] + "').offset().top" );
-               assert.equal( jQuery( this[ "id" ], doc ).offset().left, this[ "left" ], "jQuery('" + this[ "id" ] + "').offset().left" );
+               assert.equal( jQuery( this.id, doc ).offset().top,  this.top,  "jQuery('" + this.id + "').offset().top" );
+               assert.equal( jQuery( this.id, doc ).offset().left, this.left, "jQuery('" + this.id + "').offset().left" );
        } );
 
        // get position
@@ -88,8 +88,8 @@ testIframe( "absolute", "offset/absolute.html", function( assert, $, iframe ) {
                { "id": "#absolute-1", "top": 0, "left": 0 }
        ];
        jQuery.each( tests, function() {
-               assert.equal( jQuery( this[ "id" ], doc ).position().top,  this[ "top" ],  "jQuery('" + this[ "id" ] + "').position().top" );
-               assert.equal( jQuery( this[ "id" ], doc ).position().left, this[ "left" ], "jQuery('" + this[ "id" ] + "').position().left" );
+               assert.equal( jQuery( this.id, doc ).position().top,  this.top,  "jQuery('" + this.id + "').position().top" );
+               assert.equal( jQuery( this.id, doc ).position().left, this.left, "jQuery('" + this.id + "').position().left" );
        } );
 } );
 
@@ -106,8 +106,8 @@ testIframe( "absolute", "offset/absolute.html", function( assert, $ ) {
                { "id": "#absolute-2",     "top": 20, "left": 20 }
        ];
        jQuery.each( tests, function() {
-               assert.equal( $( this[ "id" ] ).offset().top,  this[ "top" ],  "jQuery('" + this[ "id" ] + "').offset().top" );
-               assert.equal( $( this[ "id" ] ).offset().left, this[ "left" ], "jQuery('" + this[ "id" ] + "').offset().left" );
+               assert.equal( $( this.id ).offset().top,  this.top,  "jQuery('" + this.id + "').offset().top" );
+               assert.equal( $( this.id ).offset().left, this.left, "jQuery('" + this.id + "').offset().left" );
        } );
 
        // get position
@@ -118,8 +118,8 @@ testIframe( "absolute", "offset/absolute.html", function( assert, $ ) {
                { "id": "#absolute-2",     "top": 19, "left": 19 }
        ];
        jQuery.each( tests, function() {
-               assert.equal( $( this[ "id" ] ).position().top,  this[ "top" ],  "jQuery('" + this[ "id" ] + "').position().top" );
-               assert.equal( $( this[ "id" ] ).position().left, this[ "left" ], "jQuery('" + this[ "id" ] + "').position().left" );
+               assert.equal( $( this.id ).position().top,  this.top,  "jQuery('" + this.id + "').position().top" );
+               assert.equal( $( this.id ).position().left, this.left, "jQuery('" + this.id + "').position().left" );
        } );
 
        // test #5781
@@ -147,34 +147,34 @@ testIframe( "absolute", "offset/absolute.html", function( assert, $ ) {
                { "id": "#absolute-1",     "top":  1, "left":  1 }
        ];
        jQuery.each( tests, function() {
-               $( this[ "id" ] ).offset( { "top": this[ "top" ], "left": this[ "left" ] } );
-               assert.equal( $( this[ "id" ] ).offset().top,  this[ "top" ],  "jQuery('" + this[ "id" ] + "').offset({ top: "  + this[ "top" ]  + " })" );
-               assert.equal( $( this[ "id" ] ).offset().left, this[ "left" ], "jQuery('" + this[ "id" ] + "').offset({ left: " + this[ "left" ] + " })" );
+               $( this.id ).offset( { "top": this.top, "left": this.left } );
+               assert.equal( $( this.id ).offset().top,  this.top,  "jQuery('" + this.id + "').offset({ top: "  + this.top  + " })" );
+               assert.equal( $( this.id ).offset().left, this.left, "jQuery('" + this.id + "').offset({ left: " + this.left + " })" );
 
-               var top = this[ "top" ], left = this[ "left" ];
+               var top = this.top, left = this.left;
 
-               $( this[ "id" ] ).offset( function( i, val ) {
+               $( this.id ).offset( function( i, val ) {
                        assert.equal( val.top, top, "Verify incoming top position." );
                        assert.equal( val.left, left, "Verify incoming top position." );
                        return { "top": top + 1, "left": left + 1 };
                } );
-               assert.equal( $( this[ "id" ] ).offset().top,  this[ "top" ]  + 1, "jQuery('" + this[ "id" ] + "').offset({ top: "  + ( this[ "top" ]  + 1 ) + " })" );
-               assert.equal( $( this[ "id" ] ).offset().left, this[ "left" ] + 1, "jQuery('" + this[ "id" ] + "').offset({ left: " + ( this[ "left" ] + 1 ) + " })" );
+               assert.equal( $( this.id ).offset().top,  this.top  + 1, "jQuery('" + this.id + "').offset({ top: "  + ( this.top  + 1 ) + " })" );
+               assert.equal( $( this.id ).offset().left, this.left + 1, "jQuery('" + this.id + "').offset({ left: " + ( this.left + 1 ) + " })" );
 
-               $( this[ "id" ] )
-                       .offset( { "left": this[ "left" ] + 2 } )
-                       .offset( { "top":  this[ "top" ]  + 2 } );
-               assert.equal( $( this[ "id" ] ).offset().top,  this[ "top" ]  + 2, "Setting one property at a time." );
-               assert.equal( $( this[ "id" ] ).offset().left, this[ "left" ] + 2, "Setting one property at a time." );
+               $( this.id )
+                       .offset( { "left": this.left + 2 } )
+                       .offset( { "top":  this.top  + 2 } );
+               assert.equal( $( this.id ).offset().top,  this.top  + 2, "Setting one property at a time." );
+               assert.equal( $( this.id ).offset().left, this.left + 2, "Setting one property at a time." );
 
-               $( this[ "id" ] ).offset( { "top": this[ "top" ], "left": this[ "left" ], "using": function( props ) {
+               $( this.id ).offset( { "top": this.top, "left": this.left, "using": function( props ) {
                        $( this ).css( {
                                "top":  props.top  + 1,
                                "left": props.left + 1
                        } );
                } } );
-               assert.equal( $( this[ "id" ] ).offset().top,  this[ "top" ]  + 1, "jQuery('" + this[ "id" ] + "').offset({ top: "  + ( this[ "top" ]  + 1 ) + ", using: fn })" );
-               assert.equal( $( this[ "id" ] ).offset().left, this[ "left" ] + 1, "jQuery('" + this[ "id" ] + "').offset({ left: " + ( this[ "left" ] + 1 ) + ", using: fn })" );
+               assert.equal( $( this.id ).offset().top,  this.top  + 1, "jQuery('" + this.id + "').offset({ top: "  + ( this.top  + 1 ) + ", using: fn })" );
+               assert.equal( $( this.id ).offset().left, this.left + 1, "jQuery('" + this.id + "').offset({ left: " + ( this.left + 1 ) + ", using: fn })" );
        } );
 } );
 
@@ -189,8 +189,8 @@ testIframe( "relative", "offset/relative.html", function( assert, $ ) {
                { "id": "#relative-2-1",   "top": 149, "left": 52 }
        ];
        jQuery.each( tests, function() {
-               assert.equal( $( this[ "id" ] ).offset().top,  this[ "top" ],  "jQuery('" + this[ "id" ] + "').offset().top" );
-               assert.equal( $( this[ "id" ] ).offset().left, this[ "left" ], "jQuery('" + this[ "id" ] + "').offset().left" );
+               assert.equal( $( this.id ).offset().top,  this.top,  "jQuery('" + this.id + "').offset().top" );
+               assert.equal( $( this.id ).offset().left, this.left, "jQuery('" + this.id + "').offset().left" );
        } );
 
        // get position
@@ -201,8 +201,8 @@ testIframe( "relative", "offset/relative.html", function( assert, $ ) {
                { "id": "#relative-2-1",   "top": 5, "left": 5 }
        ];
        jQuery.each( tests, function() {
-               assert.equal( $( this[ "id" ] ).position().top,  this[ "top" ],  "jQuery('" + this[ "id" ] + "').position().top" );
-               assert.equal( $( this[ "id" ] ).position().left, this[ "left" ], "jQuery('" + this[ "id" ] + "').position().left" );
+               assert.equal( $( this.id ).position().top,  this.top,  "jQuery('" + this.id + "').position().top" );
+               assert.equal( $( this.id ).position().left, this.left, "jQuery('" + this.id + "').position().left" );
        } );
 
        // set offset
@@ -221,18 +221,18 @@ testIframe( "relative", "offset/relative.html", function( assert, $ ) {
                { "id": "#relative-1",   "top":   7, "left":   7 }
        ];
        jQuery.each( tests, function() {
-               $( this[ "id" ] ).offset( { "top": this[ "top" ], "left": this[ "left" ] } );
-               assert.equal( $( this[ "id" ] ).offset().top,  this[ "top" ],  "jQuery('" + this[ "id" ] + "').offset({ top: "  + this[ "top" ]  + " })" );
-               assert.equal( $( this[ "id" ] ).offset().left, this[ "left" ], "jQuery('" + this[ "id" ] + "').offset({ left: " + this[ "left" ] + " })" );
+               $( this.id ).offset( { "top": this.top, "left": this.left } );
+               assert.equal( $( this.id ).offset().top,  this.top,  "jQuery('" + this.id + "').offset({ top: "  + this.top  + " })" );
+               assert.equal( $( this.id ).offset().left, this.left, "jQuery('" + this.id + "').offset({ left: " + this.left + " })" );
 
-               $( this[ "id" ] ).offset( { "top": this[ "top" ], "left": this[ "left" ], "using": function( props ) {
+               $( this.id ).offset( { "top": this.top, "left": this.left, "using": function( props ) {
                        $( this ).css( {
                                "top":  props.top  + 1,
                                "left": props.left + 1
                        } );
                } } );
-               assert.equal( $( this[ "id" ] ).offset().top,  this[ "top" ]  + 1, "jQuery('" + this[ "id" ] + "').offset({ top: "  + ( this[ "top" ]  + 1 ) + ", using: fn })" );
-               assert.equal( $( this[ "id" ] ).offset().left, this[ "left" ] + 1, "jQuery('" + this[ "id" ] + "').offset({ left: " + ( this[ "left" ] + 1 ) + ", using: fn })" );
+               assert.equal( $( this.id ).offset().top,  this.top  + 1, "jQuery('" + this.id + "').offset({ top: "  + ( this.top  + 1 ) + ", using: fn })" );
+               assert.equal( $( this.id ).offset().left, this.left + 1, "jQuery('" + this.id + "').offset({ left: " + ( this.left + 1 ) + ", using: fn })" );
        } );
 } );
 
@@ -247,8 +247,8 @@ testIframe( "static", "offset/static.html", function( assert, $ ) {
                { "id": "#static-2",     "top": 122, left: 7 }
        ];
        jQuery.each( tests, function() {
-               assert.equal( $( this[ "id" ] ).offset().top,  this[ "top" ],  "jQuery('" + this[ "id" ] + "').offset().top" );
-               assert.equal( $( this[ "id" ] ).offset().left, this[ "left" ], "jQuery('" + this[ "id" ] + "').offset().left" );
+               assert.equal( $( this.id ).offset().top,  this.top,  "jQuery('" + this.id + "').offset().top" );
+               assert.equal( $( this.id ).offset().left, this.left, "jQuery('" + this.id + "').offset().left" );
        } );
 
        // get position
@@ -259,8 +259,8 @@ testIframe( "static", "offset/static.html", function( assert, $ ) {
                { "id": "#static-2",     "top": 121, "left": 6 }
        ];
        jQuery.each( tests, function() {
-               assert.equal( $( this[ "id" ] ).position().top,  this[ "top" ],  "jQuery('" + this[ "top" ]  + "').position().top" );
-               assert.equal( $( this[ "id" ] ).position().left, this[ "left" ], "jQuery('" + this[ "left" ] + "').position().left" );
+               assert.equal( $( this.id ).position().top,  this.top,  "jQuery('" + this.top  + "').position().top" );
+               assert.equal( $( this.id ).position().left, this.left, "jQuery('" + this.left + "').position().left" );
        } );
 
        // set offset
@@ -283,18 +283,18 @@ testIframe( "static", "offset/static.html", function( assert, $ ) {
                { "id": "#static-1",     "top":   7, "left":   7 }
        ];
        jQuery.each( tests, function() {
-               $( this[ "id" ] ).offset( { "top": this[ "top" ], "left": this[ "left" ] } );
-               assert.equal( $( this[ "id" ] ).offset().top,  this[ "top" ],  "jQuery('" + this[ "id" ] + "').offset({ top: "  + this[ "top" ]  + " })" );
-               assert.equal( $( this[ "id" ] ).offset().left, this[ "left" ], "jQuery('" + this[ "id" ] + "').offset({ left: " + this[ "left" ] + " })" );
+               $( this.id ).offset( { "top": this.top, "left": this.left } );
+               assert.equal( $( this.id ).offset().top,  this.top,  "jQuery('" + this.id + "').offset({ top: "  + this.top  + " })" );
+               assert.equal( $( this.id ).offset().left, this.left, "jQuery('" + this.id + "').offset({ left: " + this.left + " })" );
 
-               $( this[ "id" ] ).offset( { "top": this[ "top" ], "left": this[ "left" ], "using": function( props ) {
+               $( this.id ).offset( { "top": this.top, "left": this.left, "using": function( props ) {
                        $( this ).css( {
                                "top":  props.top  + 1,
                                "left": props.left + 1
                        } );
                } } );
-               assert.equal( $( this[ "id" ] ).offset().top,  this[ "top" ]  + 1, "jQuery('" + this[ "id" ] + "').offset({ top: "  + ( this[ "top" ]  + 1 ) + ", using: fn })" );
-               assert.equal( $( this[ "id" ] ).offset().left, this[ "left" ] + 1, "jQuery('" + this[ "id" ] + "').offset({ left: " + ( this[ "left" ] + 1 ) + ", using: fn })" );
+               assert.equal( $( this.id ).offset().top,  this.top  + 1, "jQuery('" + this.id + "').offset({ top: "  + ( this.top  + 1 ) + ", using: fn })" );
+               assert.equal( $( this.id ).offset().left, this.left + 1, "jQuery('" + this.id + "').offset({ left: " + ( this.left + 1 ) + ", using: fn })" );
        } );
 } );
 
@@ -328,10 +328,10 @@ testIframe( "fixed", "offset/fixed.html", function( assert, $, window ) {
                        assert.ok( true, "Browser doesn't support scroll position." );
 
                } else if ( window.supportsFixedPosition ) {
-                       assert.equal( $( this[ "id" ] ).offset().top,  this[ "offsetTop" ],  "jQuery('" + this[ "id" ] + "').offset().top" );
-                       assert.equal( $( this[ "id" ] ).position().top,  this[ "positionTop" ],  "jQuery('" + this[ "id" ] + "').position().top" );
-                       assert.equal( $( this[ "id" ] ).offset().left, this[ "offsetLeft" ], "jQuery('" + this[ "id" ] + "').offset().left" );
-                       assert.equal( $( this[ "id" ] ).position().left,  this[ "positionLeft" ],  "jQuery('" + this[ "id" ] + "').position().left" );
+                       assert.equal( $( this.id ).offset().top,  this.offsetTop,  "jQuery('" + this.id + "').offset().top" );
+                       assert.equal( $( this.id ).position().top,  this.positionTop,  "jQuery('" + this.id + "').position().top" );
+                       assert.equal( $( this.id ).offset().left, this.offsetLeft, "jQuery('" + this.id + "').offset().left" );
+                       assert.equal( $( this.id ).position().left,  this.positionLeft,  "jQuery('" + this.id + "').position().left" );
                } else {
 
                        // need to have same number of assertions
@@ -353,18 +353,18 @@ testIframe( "fixed", "offset/fixed.html", function( assert, $, window ) {
 
        jQuery.each( tests, function() {
                if ( window.supportsFixedPosition ) {
-                       $( this[ "id" ] ).offset( { "top": this[ "top" ], "left": this[ "left" ] } );
-                       assert.equal( $( this[ "id" ] ).offset().top,  this[ "top" ],  "jQuery('" + this[ "id" ] + "').offset({ top: "  + this[ "top" ]  + " })" );
-                       assert.equal( $( this[ "id" ] ).offset().left, this[ "left" ], "jQuery('" + this[ "id" ] + "').offset({ left: " + this[ "left" ] + " })" );
+                       $( this.id ).offset( { "top": this.top, "left": this.left } );
+                       assert.equal( $( this.id ).offset().top,  this.top,  "jQuery('" + this.id + "').offset({ top: "  + this.top  + " })" );
+                       assert.equal( $( this.id ).offset().left, this.left, "jQuery('" + this.id + "').offset({ left: " + this.left + " })" );
 
-                       $( this[ "id" ] ).offset( { "top": this[ "top" ], "left": this[ "left" ], "using": function( props ) {
+                       $( this.id ).offset( { "top": this.top, "left": this.left, "using": function( props ) {
                                $( this ).css( {
                                        "top":  props.top  + 1,
                                        "left": props.left + 1
                                } );
                        } } );
-                       assert.equal( $( this[ "id" ] ).offset().top,  this[ "top" ]  + 1, "jQuery('" + this[ "id" ] + "').offset({ top: "  + ( this[ "top" ]  + 1 ) + ", using: fn })" );
-                       assert.equal( $( this[ "id" ] ).offset().left, this[ "left" ] + 1, "jQuery('" + this[ "id" ] + "').offset({ left: " + ( this[ "left" ] + 1 ) + ", using: fn })" );
+                       assert.equal( $( this.id ).offset().top,  this.top  + 1, "jQuery('" + this.id + "').offset({ top: "  + ( this.top  + 1 ) + ", using: fn })" );
+                       assert.equal( $( this.id ).offset().left, this.left + 1, "jQuery('" + this.id + "').offset({ left: " + ( this.left + 1 ) + ", using: fn })" );
                } else {
 
                        // need to have same number of assertions
@@ -549,8 +549,10 @@ QUnit.test( "iframe scrollTop/Left (see gh-1945)", function( assert ) {
        // Mobile Safari resize the iframe by its content meaning it's not possible to scroll
        // the iframe but only its parent element.
        // It seems (not confirmed) in android 4.0 it's not possible to scroll iframes from the code.
-       if ( /iphone os/i.test( navigator.userAgent ) ||
-           /android 4\.0/i.test( navigator.userAgent ) ) {
+       if (
+               /iphone os/i.test( navigator.userAgent ) ||
+               /android 4\.0/i.test( navigator.userAgent )
+       ) {
                assert.equal( true, true, "Can't scroll iframes in this environment" );
                assert.equal( true, true, "Can't scroll iframes in this environment" );
 
index fa8b6717a2f587fd5943dfd0a157b60bd6804073..2248c68d442d41a255cb90bc6b11149770694646 100644 (file)
@@ -232,7 +232,7 @@ QUnit.asyncTest( "fn.promise( \"queue\" ) - called whenever last queue function
 } );
 
 if ( jQuery.fn.animate ) {
-       
+
 QUnit.asyncTest( "fn.promise( \"queue\" ) - waits for animation to complete before resolving", 2, function( assert ) {
        var foo = jQuery( "#foo" ),
                test = 1;
index 4c24494254f331612014f25187c7a99a0035d7a8..0177f4ba2a34cc6797abf6ac932a7378175dfc12 100644 (file)
@@ -32,7 +32,7 @@ QUnit.test( "id", function( assert ) {
        assert.t( "ID selector with existing ID descendant", "#firstp #simon1", [ "simon1" ] );
        assert.t( "ID selector with non-existent descendant", "#firstp #foobar", [] );
        assert.t( "ID selector using UTF8", "#台北Táiběi", [ "台北Táiběi" ] );
-       assert.t( "Multiple ID selectors using UTF8", "#台北Táiběi, #台北", [ "台北Táiběi","台北" ] );
+       assert.t( "Multiple ID selectors using UTF8", "#台北Táiběi, #台北", [ "台北Táiběi", "台北" ] );
        assert.t( "Descendant ID selector using UTF8", "div #台北", [ "台北" ] );
        assert.t( "Child ID selector using UTF8", "form > #台北", [ "台北" ] );
 
@@ -103,14 +103,14 @@ QUnit.test( "selectors with comma", function( assert ) {
 QUnit.test( "child and adjacent", function( assert ) {
        assert.expect( 27 );
 
-       assert.t( "Child", "p > a", [ "simon1","google","groups","mark","yahoo","simon" ] );
-       assert.t( "Child", "p> a", [ "simon1","google","groups","mark","yahoo","simon" ] );
-       assert.t( "Child", "p >a", [ "simon1","google","groups","mark","yahoo","simon" ] );
-       assert.t( "Child", "p>a", [ "simon1","google","groups","mark","yahoo","simon" ] );
-       assert.t( "Child w/ Class", "p > a.blog", [ "mark","simon" ] );
-       assert.t( "All Children", "code > *", [ "anchor1","anchor2" ] );
-       assert.selectInFixture( "All Grandchildren", "p > * > *", [ "anchor1","anchor2" ] );
-       assert.t( "Adjacent", "p + p", [ "ap","en","sap" ] );
+       assert.t( "Child", "p > a", [ "simon1", "google", "groups", "mark", "yahoo", "simon" ] );
+       assert.t( "Child", "p> a", [ "simon1", "google", "groups", "mark", "yahoo", "simon" ] );
+       assert.t( "Child", "p >a", [ "simon1", "google", "groups", "mark", "yahoo", "simon" ] );
+       assert.t( "Child", "p>a", [ "simon1", "google", "groups", "mark", "yahoo", "simon" ] );
+       assert.t( "Child w/ Class", "p > a.blog", [ "mark", "simon" ] );
+       assert.t( "All Children", "code > *", [ "anchor1", "anchor2" ] );
+       assert.selectInFixture( "All Grandchildren", "p > * > *", [ "anchor1", "anchor2" ] );
+       assert.t( "Adjacent", "p + p", [ "ap", "en", "sap" ] );
        assert.t( "Adjacent", "p#firstp + p", [ "ap" ] );
        assert.t( "Adjacent", "p[lang=en] + p", [ "sap" ] );
        assert.t( "Adjacent", "a.GROUPS + code + a", [ "mark" ] );
@@ -163,7 +163,7 @@ QUnit.test( "attributes", function( assert ) {
        assert.t( "Attribute Equals", "#qunit-fixture a[rel=bookmark]", [ "simon1" ] );
        assert.t( "Attribute Equals", "#qunit-fixture a[href='http://www.google.com/']", [ "google" ] );
        assert.t( "Attribute Equals", "#qunit-fixture a[ rel = 'bookmark' ]", [ "simon1" ] );
-       assert.t( "Attribute Equals Number", "#qunit-fixture option[value='1']", [ "option1b","option2b","option3b","option4b","option5c" ] );
+       assert.t( "Attribute Equals Number", "#qunit-fixture option[value='1']", [ "option1b", "option2b", "option3b", "option4b", "option5c" ] );
        assert.t( "Attribute Equals Number", "#qunit-fixture li[tabIndex='-1']", [ "foodWithNegativeTabIndex" ] );
 
        document.getElementById( "anchor2" ).href = "#2";
@@ -187,13 +187,13 @@ QUnit.test( "attributes", function( assert ) {
 
        assert.t( "Attribute selector using UTF8", "span[lang=中文]", [ "台北" ] );
 
-       assert.t( "Attribute Begins With", "a[href ^= 'http://www']", [ "google","yahoo" ] );
+       assert.t( "Attribute Begins With", "a[href ^= 'http://www']", [ "google", "yahoo" ] );
        assert.t( "Attribute Ends With", "a[href $= 'org/']", [ "mark" ] );
-       assert.t( "Attribute Contains", "a[href *= 'google']", [ "google","groups" ] );
+       assert.t( "Attribute Contains", "a[href *= 'google']", [ "google", "groups" ] );
 
        if ( jQuery.find.compile ) {
-               assert.t( "Empty values", "#select1 option[value!='']", [ "option1b","option1c","option1d" ] );
-               assert.t( "Attribute Is Not Equal", "#ap a[hreflang!='en']", [ "google","groups","anchor1" ] );
+               assert.t( "Empty values", "#select1 option[value!='']", [ "option1b", "option1c", "option1d" ] );
+               assert.t( "Attribute Is Not Equal", "#ap a[hreflang!='en']", [ "google", "groups", "anchor1" ] );
                assert.t( "Select options via :selected", "#select1 option:selected", [ "option1a" ] );
                assert.t( "Select options via :selected", "#select2 option:selected", [ "option2d" ] );
                assert.t( "Select options via :selected", "#select3 option:selected", [ "option3b", "option3c" ] );
@@ -493,7 +493,7 @@ testIframe(
        "Sizzle cache collides with multiple Sizzles on a page",
        "selector/sizzle_cache.html",
        function( assert, jQuery, window, document ) {
-               var $cached = window[ "$cached" ];
+               var $cached = window.$cached;
 
                assert.expect( 4 );
                assert.notStrictEqual( jQuery, $cached, "Loaded two engines" );
index 4c141637301e877400a03e9c2400380fa8050556..9d0afd7c32b8d4d87576caf2503202d227addaea 100644 (file)
@@ -8,7 +8,7 @@ QUnit.test( "jQuery.param()", function( assert ) {
        params = { "foo":"bar", "baz":42, "quux":"All your base are belong to us" };
        assert.equal( jQuery.param( params ), "foo=bar&baz=42&quux=All%20your%20base%20are%20belong%20to%20us", "simple" );
 
-       params = { "string":"foo","null":null,"undefined":undefined };
+       params = { "string":"foo", "null":null, "undefined":undefined };
        assert.equal( jQuery.param( params ), "string=foo&null=&undefined=", "handle nulls and undefineds properly" );
 
        params = { "someName": [ 1, 2, 3 ], "regularThing": "blah" };
@@ -23,16 +23,16 @@ QUnit.test( "jQuery.param()", function( assert ) {
        params = { "foo": { "bar": "baz", "beep": 42, "quux": "All your base are belong to us" } };
        assert.equal( jQuery.param( params ), "foo%5Bbar%5D=baz&foo%5Bbeep%5D=42&foo%5Bquux%5D=All%20your%20base%20are%20belong%20to%20us", "even more arrays" );
 
-       params = { a:[ 1,2 ], b:{ c:3, d:[ 4,5 ], e:{ x:[ 6 ], y:7, z:[ 8,9 ] }, f:true, g:false, h:undefined }, i:[ 10,11 ], j:true, k:false, l:[ undefined,0 ], m:"cowboy hat?" };
+       params = { a:[ 1, 2 ], b:{ c:3, d:[ 4, 5 ], e:{ x:[ 6 ], y:7, z:[ 8, 9 ] }, f:true, g:false, h:undefined }, i:[ 10, 11 ], j:true, k:false, l:[ undefined, 0 ], m:"cowboy hat?" };
        assert.equal( decodeURIComponent( jQuery.param( params ) ), "a[]=1&a[]=2&b[c]=3&b[d][]=4&b[d][]=5&b[e][x][]=6&b[e][y]=7&b[e][z][]=8&b[e][z][]=9&b[f]=true&b[g]=false&b[h]=&i[]=10&i[]=11&j=true&k=false&l[]=&l[]=0&m=cowboy hat?", "huge structure" );
 
        params = { "a": [ 0, [ 1, 2 ], [ 3, [ 4, 5 ], [ 6 ] ], { "b": [ 7, [ 8, 9 ], [ { "c": 10, "d": 11 } ], [ [ 12 ] ], [ [ [ 13 ] ] ], { "e": { "f": { "g": [ 14, [ 15 ] ] } } }, 16 ] }, 17 ] };
        assert.equal( decodeURIComponent( jQuery.param( params ) ), "a[]=0&a[1][]=1&a[1][]=2&a[2][]=3&a[2][1][]=4&a[2][1][]=5&a[2][2][]=6&a[3][b][]=7&a[3][b][1][]=8&a[3][b][1][]=9&a[3][b][2][0][c]=10&a[3][b][2][0][d]=11&a[3][b][3][0][]=12&a[3][b][4][0][0][]=13&a[3][b][5][e][f][g][]=14&a[3][b][5][e][f][g][1][]=15&a[3][b][]=16&a[]=17", "nested arrays" );
 
-       params = { "a":[ 1,2 ], "b":{ "c":3, "d":[ 4,5 ], "e":{ "x":[ 6 ], "y":7, "z":[ 8,9 ] }, "f":true, "g":false, "h":undefined }, "i":[ 10,11 ], "j":true, "k":false, "l":[ undefined,0 ], "m":"cowboy hat?" };
+       params = { "a":[ 1, 2 ], "b":{ "c":3, "d":[ 4, 5 ], "e":{ "x":[ 6 ], "y":7, "z":[ 8, 9 ] }, "f":true, "g":false, "h":undefined }, "i":[ 10, 11 ], "j":true, "k":false, "l":[ undefined, 0 ], "m":"cowboy hat?" };
        assert.equal( jQuery.param( params, true ), "a=1&a=2&b=%5Bobject%20Object%5D&i=10&i=11&j=true&k=false&l=&l=0&m=cowboy%20hat%3F", "huge structure, forced traditional" );
 
-       assert.equal( decodeURIComponent( jQuery.param( { "a": [ 1,2,3 ], "b[]": [ 4,5,6 ], "c[d]": [ 7,8,9 ], "e": { "f": [ 10 ], "g": [ 11,12 ], "h": 13 } } ) ), "a[]=1&a[]=2&a[]=3&b[]=4&b[]=5&b[]=6&c[d][]=7&c[d][]=8&c[d][]=9&e[f][]=10&e[g][]=11&e[g][]=12&e[h]=13", "Make sure params are not double-encoded." );
+       assert.equal( decodeURIComponent( jQuery.param( { "a": [ 1, 2, 3 ], "b[]": [ 4, 5, 6 ], "c[d]": [ 7, 8, 9 ], "e": { "f": [ 10 ], "g": [ 11, 12 ], "h": 13 } } ) ), "a[]=1&a[]=2&a[]=3&b[]=4&b[]=5&b[]=6&c[d][]=7&c[d][]=8&c[d][]=9&e[f][]=10&e[g][]=11&e[g][]=12&e[h]=13", "Make sure params are not double-encoded." );
 
        // #7945
        assert.equal( jQuery.param( { "jquery": "1.4.2" } ), "jquery=1.4.2", "Check that object with a jQuery property get serialized correctly" );
@@ -52,13 +52,13 @@ QUnit.test( "jQuery.param()", function( assert ) {
        params = { "foo[bar]":"baz", "foo[beep]":42, "foo[quux]":"All your base are belong to us" };
        assert.equal( jQuery.param( params, true ), "foo%5Bbar%5D=baz&foo%5Bbeep%5D=42&foo%5Bquux%5D=All%20your%20base%20are%20belong%20to%20us", "even more arrays" );
 
-       params = { a:[ 1,2 ], b:{ c:3, d:[ 4,5 ], e:{ x:[ 6 ], y:7, z:[ 8,9 ] }, f:true, g:false, h:undefined }, i:[ 10,11 ], j:true, k:false, l:[ undefined,0 ], m:"cowboy hat?" };
+       params = { a:[ 1, 2 ], b:{ c:3, d:[ 4, 5 ], e:{ x:[ 6 ], y:7, z:[ 8, 9 ] }, f:true, g:false, h:undefined }, i:[ 10, 11 ], j:true, k:false, l:[ undefined, 0 ], m:"cowboy hat?" };
        assert.equal( jQuery.param( params, true ), "a=1&a=2&b=%5Bobject%20Object%5D&i=10&i=11&j=true&k=false&l=&l=0&m=cowboy%20hat%3F", "huge structure" );
 
        params = { "a": [ 0, [ 1, 2 ], [ 3, [ 4, 5 ], [ 6 ] ], { "b": [ 7, [ 8, 9 ], [ { "c": 10, d: 11 } ], [ [ 12 ] ], [ [ [ 13 ] ] ], { "e": { "f": { "g": [ 14, [ 15 ] ] } } }, 16 ] }, 17 ] };
        assert.equal( jQuery.param( params, true ), "a=0&a=1%2C2&a=3%2C4%2C5%2C6&a=%5Bobject%20Object%5D&a=17", "nested arrays (not possible when traditional == true)" );
 
-       params = { a:[ 1,2 ], b:{ c:3, d:[ 4,5 ], e:{ x:[ 6 ], y:7, z:[ 8,9 ] }, f:true, g:false, h:undefined }, i:[ 10,11 ], j:true, k:false, l:[ undefined,0 ], m:"cowboy hat?" };
+       params = { a:[ 1, 2 ], b:{ c:3, d:[ 4, 5 ], e:{ x:[ 6 ], y:7, z:[ 8, 9 ] }, f:true, g:false, h:undefined }, i:[ 10, 11 ], j:true, k:false, l:[ undefined, 0 ], m:"cowboy hat?" };
        assert.equal( decodeURIComponent( jQuery.param( params ) ), "a[]=1&a[]=2&b[c]=3&b[d][]=4&b[d][]=5&b[e][x][]=6&b[e][y]=7&b[e][z][]=8&b[e][z][]=9&b[f]=true&b[g]=false&b[h]=&i[]=10&i[]=11&j=true&k=false&l[]=&l[]=0&m=cowboy hat?", "huge structure, forced not traditional" );
 
        params = { "param1": null };
@@ -92,7 +92,7 @@ QUnit.test( "jQuery.param() Constructed prop values", function( assert ) {
 
        /** @constructor */
        function Record() {
-               this[ "prop" ] = "val";
+               this.prop = "val";
        }
 
        var MyString = String,
index 02994bafaeaaf97029d62a5686b782e5974d6752..65af2b4b2d93466bb3ea01a82fa1897d38930aa3 100644 (file)
@@ -472,7 +472,7 @@ QUnit.test( "unwrap( selector )", function( assert ) {
                jQuery( "#unwrap1" ).length, 1, "still wrapped"
        );
 
-        // Shouldn't unwrap, no match
+       // Shouldn't unwrap, no match
        jQuery( "#unwrap1 span" ) .unwrap( "span" );
        assert.equal(
                jQuery( "#unwrap1" ).length, 1, "still wrapped"