From 305f193aa57014dc7d8fa0739a3fefd47166cd44 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Micha=C5=82=20Go=C5=82=C4=99biowski?= Date: Mon, 25 Apr 2016 20:25:08 +0200 Subject: [PATCH] Build: Put all AMD modules in "src/" in strict mode Fixes gh-3073 --- src/.jshintrc | 1 + src/ajax.js | 2 ++ src/ajax/jsonp.js | 2 ++ src/ajax/load.js | 2 ++ src/ajax/parseXML.js | 2 ++ src/ajax/script.js | 2 ++ src/ajax/var/location.js | 2 ++ src/ajax/var/nonce.js | 2 ++ src/ajax/var/rquery.js | 2 ++ src/ajax/xhr.js | 2 ++ src/attributes.js | 2 ++ src/attributes/attr.js | 2 ++ src/attributes/classes.js | 2 ++ src/attributes/prop.js | 2 ++ src/attributes/support.js | 2 ++ src/attributes/val.js | 2 ++ src/callbacks.js | 2 ++ src/core.js | 2 ++ src/core/DOMEval.js | 2 ++ src/core/access.js | 2 ++ src/core/init.js | 2 ++ src/core/parseHTML.js | 2 ++ src/core/ready-no-deferred.js | 2 ++ src/core/ready.js | 2 ++ src/core/support.js | 2 ++ src/core/var/rsingleTag.js | 1 + src/css.js | 2 ++ src/css/addGetHookIf.js | 2 ++ src/css/adjustCSS.js | 2 ++ src/css/curCSS.js | 2 ++ src/css/hiddenVisibleSelectors.js | 2 ++ src/css/showHide.js | 2 ++ src/css/support.js | 2 ++ src/css/var/cssExpand.js | 2 ++ src/css/var/getStyles.js | 2 ++ src/css/var/isHiddenWithinTree.js | 1 + src/css/var/rmargin.js | 2 ++ src/css/var/rnumnonpx.js | 2 ++ src/css/var/swap.js | 2 ++ src/data.js | 2 ++ src/data/Data.js | 2 ++ src/data/var/acceptData.js | 2 ++ src/data/var/dataPriv.js | 2 ++ src/data/var/dataUser.js | 2 ++ src/deferred/exceptionHook.js | 2 ++ src/deprecated.js | 2 ++ src/dimensions.js | 2 ++ src/effects.js | 2 ++ src/effects/Tween.js | 2 ++ src/effects/animatedSelector.js | 2 ++ src/event.js | 2 ++ src/event/ajax.js | 2 ++ src/event/alias.js | 2 ++ src/event/focusin.js | 2 ++ src/event/support.js | 2 ++ src/event/trigger.js | 2 ++ src/exports/amd.js | 2 ++ src/exports/global.js | 4 ++++ src/jquery.js | 2 ++ src/manipulation.js | 2 ++ src/manipulation/_evalUrl.js | 2 ++ src/manipulation/buildFragment.js | 2 ++ src/manipulation/getAll.js | 2 ++ src/manipulation/setGlobalEval.js | 2 ++ src/manipulation/support.js | 2 ++ src/manipulation/var/rcheckableType.js | 2 ++ src/manipulation/var/rscriptType.js | 2 ++ src/manipulation/var/rtagName.js | 2 ++ src/manipulation/wrapMap.js | 2 ++ src/offset.js | 2 ++ src/queue.js | 2 ++ src/queue/delay.js | 2 ++ src/selector-native.js | 2 ++ src/selector-sizzle.js | 2 ++ src/serialize.js | 2 ++ src/traversing.js | 2 ++ src/traversing/findFilter.js | 2 ++ src/traversing/var/dir.js | 2 ++ src/traversing/var/rneedsContext.js | 2 ++ src/traversing/var/siblings.js | 2 ++ src/var/ObjectFunctionString.js | 2 ++ src/var/arr.js | 2 ++ src/var/class2type.js | 1 + src/var/concat.js | 2 ++ src/var/document.js | 2 ++ src/var/documentElement.js | 2 ++ src/var/fnToString.js | 2 ++ src/var/getProto.js | 2 ++ src/var/hasOwn.js | 2 ++ src/var/indexOf.js | 2 ++ src/var/pnum.js | 2 ++ src/var/push.js | 2 ++ src/var/rcssNum.js | 2 ++ src/var/rnotwhite.js | 2 ++ src/var/slice.js | 2 ++ src/var/support.js | 1 + src/var/toString.js | 2 ++ src/wrap.js | 2 ++ src/wrapper.js | 2 ++ 99 files changed, 195 insertions(+) diff --git a/src/.jshintrc b/src/.jshintrc index a45fdb5ba..c3506e70f 100644 --- a/src/.jshintrc +++ b/src/.jshintrc @@ -7,6 +7,7 @@ "immed": true, "noarg": true, "quotmark": "double", + "strict": true, "undef": true, "unused": true, diff --git a/src/ajax.js b/src/ajax.js index 436933159..fd6679936 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -13,6 +13,8 @@ define( [ "./serialize" // jQuery.param ], function( jQuery, document, rnotwhite, location, nonce, rquery ) { +"use strict"; + var r20 = /%20/g, rhash = /#.*$/, diff --git a/src/ajax/jsonp.js b/src/ajax/jsonp.js index 666e5d1e6..8c406e722 100644 --- a/src/ajax/jsonp.js +++ b/src/ajax/jsonp.js @@ -5,6 +5,8 @@ define( [ "../ajax" ], function( jQuery, nonce, rquery ) { +"use strict"; + var oldCallbacks = [], rjsonp = /(=)\?(?=&|$)|\?\?/; diff --git a/src/ajax/load.js b/src/ajax/load.js index aa6e1cfab..1058dbf52 100644 --- a/src/ajax/load.js +++ b/src/ajax/load.js @@ -7,6 +7,8 @@ define( [ "../selector" ], function( jQuery ) { +"use strict"; + /** * Load a url into a page */ diff --git a/src/ajax/parseXML.js b/src/ajax/parseXML.js index 8b13139a5..acf7ab259 100644 --- a/src/ajax/parseXML.js +++ b/src/ajax/parseXML.js @@ -2,6 +2,8 @@ define( [ "../core" ], function( jQuery ) { +"use strict"; + // Cross-browser xml parsing jQuery.parseXML = function( data ) { var xml; diff --git a/src/ajax/script.js b/src/ajax/script.js index 485ba397b..6e0d21e99 100644 --- a/src/ajax/script.js +++ b/src/ajax/script.js @@ -4,6 +4,8 @@ define( [ "../ajax" ], function( jQuery, document ) { +"use strict"; + // Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) jQuery.ajaxPrefilter( function( s ) { if ( s.crossDomain ) { diff --git a/src/ajax/var/location.js b/src/ajax/var/location.js index ff9578e99..4171d18c3 100644 --- a/src/ajax/var/location.js +++ b/src/ajax/var/location.js @@ -1,3 +1,5 @@ define( function() { + "use strict"; + return window.location; } ); diff --git a/src/ajax/var/nonce.js b/src/ajax/var/nonce.js index 83fd557c8..6e23708a8 100644 --- a/src/ajax/var/nonce.js +++ b/src/ajax/var/nonce.js @@ -1,5 +1,7 @@ define( [ "../../core" ], function( jQuery ) { + "use strict"; + return jQuery.now(); } ); diff --git a/src/ajax/var/rquery.js b/src/ajax/var/rquery.js index 0502146ca..06fc37439 100644 --- a/src/ajax/var/rquery.js +++ b/src/ajax/var/rquery.js @@ -1,3 +1,5 @@ define( function() { + "use strict"; + return ( /\?/ ); } ); diff --git a/src/ajax/xhr.js b/src/ajax/xhr.js index 5a93891ab..33dafb01d 100644 --- a/src/ajax/xhr.js +++ b/src/ajax/xhr.js @@ -4,6 +4,8 @@ define( [ "../ajax" ], function( jQuery, support ) { +"use strict"; + jQuery.ajaxSettings.xhr = function() { try { return new window.XMLHttpRequest(); diff --git a/src/attributes.js b/src/attributes.js index 691e0c034..2d801e563 100644 --- a/src/attributes.js +++ b/src/attributes.js @@ -6,6 +6,8 @@ define( [ "./attributes/val" ], function( jQuery ) { +"use strict"; + // Return jQuery for attributes-only inclusion return jQuery; } ); diff --git a/src/attributes/attr.js b/src/attributes/attr.js index 51bba773e..0e4e3b225 100644 --- a/src/attributes/attr.js +++ b/src/attributes/attr.js @@ -6,6 +6,8 @@ define( [ "../selector" ], function( jQuery, access, support, rnotwhite ) { +"use strict"; + var boolHook, attrHandle = jQuery.expr.attrHandle; diff --git a/src/attributes/classes.js b/src/attributes/classes.js index 7933873c4..2e8a8caba 100644 --- a/src/attributes/classes.js +++ b/src/attributes/classes.js @@ -5,6 +5,8 @@ define( [ "../core/init" ], function( jQuery, rnotwhite, dataPriv ) { +"use strict"; + var rclass = /[\t\r\n\f]/g; function getClass( elem ) { diff --git a/src/attributes/prop.js b/src/attributes/prop.js index 908c19ff6..2f73a8508 100644 --- a/src/attributes/prop.js +++ b/src/attributes/prop.js @@ -5,6 +5,8 @@ define( [ "../selector" ], function( jQuery, access, support ) { +"use strict"; + var rfocusable = /^(?:input|select|textarea|button)$/i, rclickable = /^(?:a|area)$/i; diff --git a/src/attributes/support.js b/src/attributes/support.js index ee6115a68..af60e9694 100644 --- a/src/attributes/support.js +++ b/src/attributes/support.js @@ -3,6 +3,8 @@ define( [ "../var/support" ], function( document, support ) { +"use strict"; + ( function() { var input = document.createElement( "input" ), select = document.createElement( "select" ), diff --git a/src/attributes/val.js b/src/attributes/val.js index ace17040b..757680607 100644 --- a/src/attributes/val.js +++ b/src/attributes/val.js @@ -4,6 +4,8 @@ define( [ "../core/init" ], function( jQuery, support ) { +"use strict"; + var rreturn = /\r/g, rspaces = /[\x20\t\r\n\f]+/g; diff --git a/src/callbacks.js b/src/callbacks.js index b032c8f1c..4c4f73327 100644 --- a/src/callbacks.js +++ b/src/callbacks.js @@ -3,6 +3,8 @@ define( [ "./var/rnotwhite" ], function( jQuery, rnotwhite ) { +"use strict"; + // Convert String-formatted options into Object-formatted ones function createOptions( options ) { var object = {}; diff --git a/src/core.js b/src/core.js index 7c2433529..9dd05294e 100644 --- a/src/core.js +++ b/src/core.js @@ -17,6 +17,8 @@ define( [ class2type, toString, hasOwn, fnToString, ObjectFunctionString, support, DOMEval ) { +"use strict"; + var version = "@VERSION", diff --git a/src/core/DOMEval.js b/src/core/DOMEval.js index 222b0ca2a..c49c12e5e 100644 --- a/src/core/DOMEval.js +++ b/src/core/DOMEval.js @@ -1,6 +1,8 @@ define( [ "../var/document" ], function( document ) { + "use strict"; + function DOMEval( code, doc ) { doc = doc || document; diff --git a/src/core/access.js b/src/core/access.js index 19f79efa4..735c75711 100644 --- a/src/core/access.js +++ b/src/core/access.js @@ -2,6 +2,8 @@ define( [ "../core" ], function( jQuery ) { +"use strict"; + // Multifunctional method to get and set values of a collection // The value/s can optionally be executed if it's a function var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { diff --git a/src/core/init.js b/src/core/init.js index a00d58791..19a3c7c68 100644 --- a/src/core/init.js +++ b/src/core/init.js @@ -6,6 +6,8 @@ define( [ "../traversing/findFilter" ], function( jQuery, document, rsingleTag ) { +"use strict"; + // A central reference to the root jQuery(document) var rootjQuery, diff --git a/src/core/parseHTML.js b/src/core/parseHTML.js index 260fd3ca7..21ff6bfa7 100644 --- a/src/core/parseHTML.js +++ b/src/core/parseHTML.js @@ -8,6 +8,8 @@ define( [ "./support" ], function( jQuery, document, rsingleTag, buildFragment, support ) { +"use strict"; + // Argument "data" should be string of html // context (optional): If specified, the fragment will be created in this context, // defaults to document diff --git a/src/core/ready-no-deferred.js b/src/core/ready-no-deferred.js index 66f209bf7..5baed2e5c 100644 --- a/src/core/ready-no-deferred.js +++ b/src/core/ready-no-deferred.js @@ -3,6 +3,8 @@ define( [ "../var/document" ], function( jQuery, document ) { +"use strict"; + var readyCallbacks = [], readyFiring = false, whenReady = function( fn ) { diff --git a/src/core/ready.js b/src/core/ready.js index b98ff5ba0..bb4e222d3 100644 --- a/src/core/ready.js +++ b/src/core/ready.js @@ -4,6 +4,8 @@ define( [ "../deferred" ], function( jQuery, document ) { +"use strict"; + // The deferred used on DOM ready var readyList = jQuery.Deferred(); diff --git a/src/core/support.js b/src/core/support.js index 3857a252e..13ae02f08 100644 --- a/src/core/support.js +++ b/src/core/support.js @@ -3,6 +3,8 @@ define( [ "../var/support" ], function( document, support ) { +"use strict"; + // Support: Safari 8 only // In Safari 8 documents created via document.implementation.createHTMLDocument // collapse sibling forms: the second one becomes a child of the first one. diff --git a/src/core/var/rsingleTag.js b/src/core/var/rsingleTag.js index 1ddf95ed4..4d6e8a0ac 100644 --- a/src/core/var/rsingleTag.js +++ b/src/core/var/rsingleTag.js @@ -1,4 +1,5 @@ define( function() { + "use strict"; // Match a standalone tag return ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); diff --git a/src/css.js b/src/css.js index 9e673fc18..131df67de 100644 --- a/src/css.js +++ b/src/css.js @@ -20,6 +20,8 @@ define( [ ], function( jQuery, pnum, access, rmargin, document, rcssNum, rnumnonpx, cssExpand, getStyles, swap, curCSS, adjustCSS, addGetHookIf, support ) { +"use strict"; + var // Swappable if display is none or starts with table diff --git a/src/css/addGetHookIf.js b/src/css/addGetHookIf.js index 9cd21f683..e4bb49a67 100644 --- a/src/css/addGetHookIf.js +++ b/src/css/addGetHookIf.js @@ -1,5 +1,7 @@ define( function() { +"use strict"; + function addGetHookIf( conditionFn, hookFn ) { // Define the hook, we'll check on the first run if it's really needed. diff --git a/src/css/adjustCSS.js b/src/css/adjustCSS.js index 48fcfec05..f1d1f00ce 100644 --- a/src/css/adjustCSS.js +++ b/src/css/adjustCSS.js @@ -3,6 +3,8 @@ define( [ "../var/rcssNum" ], function( jQuery, rcssNum ) { +"use strict"; + function adjustCSS( elem, prop, valueParts, tween ) { var adjusted, scale = 1, diff --git a/src/css/curCSS.js b/src/css/curCSS.js index 5f738c2d0..313da4222 100644 --- a/src/css/curCSS.js +++ b/src/css/curCSS.js @@ -7,6 +7,8 @@ define( [ "../selector" // Get jQuery.contains ], function( jQuery, rnumnonpx, rmargin, getStyles, support ) { +"use strict"; + function curCSS( elem, name, computed ) { var width, minWidth, maxWidth, ret, style = elem.style; diff --git a/src/css/hiddenVisibleSelectors.js b/src/css/hiddenVisibleSelectors.js index e155acda7..d7a9339dd 100644 --- a/src/css/hiddenVisibleSelectors.js +++ b/src/css/hiddenVisibleSelectors.js @@ -3,6 +3,8 @@ define( [ "../selector" ], function( jQuery ) { +"use strict"; + jQuery.expr.pseudos.hidden = function( elem ) { return !jQuery.expr.pseudos.visible( elem ); }; diff --git a/src/css/showHide.js b/src/css/showHide.js index 7e9002ca5..11b1479d9 100644 --- a/src/css/showHide.js +++ b/src/css/showHide.js @@ -4,6 +4,8 @@ define( [ "../css/var/isHiddenWithinTree" ], function( jQuery, dataPriv, isHiddenWithinTree ) { +"use strict"; + var defaultDisplayMap = {}; function getDefaultDisplay( elem ) { diff --git a/src/css/support.js b/src/css/support.js index 73a5e6e1a..883d0e53e 100644 --- a/src/css/support.js +++ b/src/css/support.js @@ -5,6 +5,8 @@ define( [ "../var/support" ], function( jQuery, document, documentElement, support ) { +"use strict"; + ( function() { // Executing both pixelPosition & boxSizingReliable tests require only one layout diff --git a/src/css/var/cssExpand.js b/src/css/var/cssExpand.js index 9f8194dc8..dd2007c3f 100644 --- a/src/css/var/cssExpand.js +++ b/src/css/var/cssExpand.js @@ -1,3 +1,5 @@ define( function() { + "use strict"; + return [ "Top", "Right", "Bottom", "Left" ]; } ); diff --git a/src/css/var/getStyles.js b/src/css/var/getStyles.js index f3aab668b..0b893acf0 100644 --- a/src/css/var/getStyles.js +++ b/src/css/var/getStyles.js @@ -1,4 +1,6 @@ define( function() { + "use strict"; + return function( elem ) { // Support: IE <=11 only, Firefox <=30 (#15098, #14150) diff --git a/src/css/var/isHiddenWithinTree.js b/src/css/var/isHiddenWithinTree.js index c01d228d8..3cfb93e16 100644 --- a/src/css/var/isHiddenWithinTree.js +++ b/src/css/var/isHiddenWithinTree.js @@ -4,6 +4,7 @@ define( [ // css is assumed ], function( jQuery ) { + "use strict"; // isHiddenWithinTree reports if an element has a non-"none" display style (inline and/or // through the CSS cascade), which is useful in deciding whether or not to make it visible. diff --git a/src/css/var/rmargin.js b/src/css/var/rmargin.js index 9be221243..0fbfbd853 100644 --- a/src/css/var/rmargin.js +++ b/src/css/var/rmargin.js @@ -1,3 +1,5 @@ define( function() { + "use strict"; + return ( /^margin/ ); } ); diff --git a/src/css/var/rnumnonpx.js b/src/css/var/rnumnonpx.js index ed13f0b98..056cda7ad 100644 --- a/src/css/var/rnumnonpx.js +++ b/src/css/var/rnumnonpx.js @@ -1,5 +1,7 @@ define( [ "../../var/pnum" ], function( pnum ) { + "use strict"; + return new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); } ); diff --git a/src/css/var/swap.js b/src/css/var/swap.js index b6d3b679f..1a9556bad 100644 --- a/src/css/var/swap.js +++ b/src/css/var/swap.js @@ -1,5 +1,7 @@ define( function() { +"use strict"; + // A method for quickly swapping in/out CSS properties to get correct calculations. return function( elem, options, callback, args ) { var ret, name, diff --git a/src/data.js b/src/data.js index 80e8bacf5..49964f7d5 100644 --- a/src/data.js +++ b/src/data.js @@ -5,6 +5,8 @@ define( [ "./data/var/dataUser" ], function( jQuery, access, dataPriv, dataUser ) { +"use strict"; + // Implementation Summary // // 1. Enforce API surface and semantic compatibility with 1.9.x branch diff --git a/src/data/Data.js b/src/data/Data.js index cc8822a3c..0901c6bfe 100644 --- a/src/data/Data.js +++ b/src/data/Data.js @@ -4,6 +4,8 @@ define( [ "./var/acceptData" ], function( jQuery, rnotwhite, acceptData ) { +"use strict"; + function Data() { this.expando = jQuery.expando + Data.uid++; } diff --git a/src/data/var/acceptData.js b/src/data/var/acceptData.js index 6e15af127..7d0fb238e 100644 --- a/src/data/var/acceptData.js +++ b/src/data/var/acceptData.js @@ -1,5 +1,7 @@ define( function() { +"use strict"; + /** * Determines whether an object can have data */ diff --git a/src/data/var/dataPriv.js b/src/data/var/dataPriv.js index 9a1343ce1..72713c88c 100644 --- a/src/data/var/dataPriv.js +++ b/src/data/var/dataPriv.js @@ -1,5 +1,7 @@ define( [ "../Data" ], function( Data ) { + "use strict"; + return new Data(); } ); diff --git a/src/data/var/dataUser.js b/src/data/var/dataUser.js index 9a1343ce1..72713c88c 100644 --- a/src/data/var/dataUser.js +++ b/src/data/var/dataUser.js @@ -1,5 +1,7 @@ define( [ "../Data" ], function( Data ) { + "use strict"; + return new Data(); } ); diff --git a/src/deferred/exceptionHook.js b/src/deferred/exceptionHook.js index 99d2819bf..7d4a296f4 100644 --- a/src/deferred/exceptionHook.js +++ b/src/deferred/exceptionHook.js @@ -3,6 +3,8 @@ define( [ "../deferred" ], function( jQuery ) { +"use strict"; + // These usually indicate a programmer mistake during development, // warn about them ASAP rather than swallowing them by default. var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; diff --git a/src/deprecated.js b/src/deprecated.js index 79522e9b1..9fcc6b7da 100644 --- a/src/deprecated.js +++ b/src/deprecated.js @@ -2,6 +2,8 @@ define( [ "./core" ], function( jQuery ) { +"use strict"; + jQuery.fn.extend( { bind: function( types, data, fn ) { diff --git a/src/dimensions.js b/src/dimensions.js index 3d4dbff10..46e7b1c46 100644 --- a/src/dimensions.js +++ b/src/dimensions.js @@ -4,6 +4,8 @@ define( [ "./css" ], function( jQuery, access ) { +"use strict"; + // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, diff --git a/src/effects.js b/src/effects.js index 4adb23024..6a1fb3a28 100644 --- a/src/effects.js +++ b/src/effects.js @@ -20,6 +20,8 @@ define( [ ], function( jQuery, document, rcssNum, rnotwhite, cssExpand, isHiddenWithinTree, swap, adjustCSS, dataPriv, showHide ) { +"use strict"; + var fxNow, timerId, rfxtypes = /^(?:toggle|show|hide)$/, diff --git a/src/effects/Tween.js b/src/effects/Tween.js index 399823901..66f4df106 100644 --- a/src/effects/Tween.js +++ b/src/effects/Tween.js @@ -3,6 +3,8 @@ define( [ "../css" ], function( jQuery ) { +"use strict"; + function Tween( elem, options, prop, end, easing ) { return new Tween.prototype.init( elem, options, prop, end, easing ); } diff --git a/src/effects/animatedSelector.js b/src/effects/animatedSelector.js index 2fe1f71a7..24c1bfba2 100644 --- a/src/effects/animatedSelector.js +++ b/src/effects/animatedSelector.js @@ -4,6 +4,8 @@ define( [ "../effects" ], function( jQuery ) { +"use strict"; + jQuery.expr.pseudos.animated = function( elem ) { return jQuery.grep( jQuery.timers, function( fn ) { return elem === fn.elem; diff --git a/src/event.js b/src/event.js index ddd117cfe..e382de6d2 100644 --- a/src/event.js +++ b/src/event.js @@ -9,6 +9,8 @@ define( [ "./selector" ], function( jQuery, document, rnotwhite, slice, dataPriv ) { +"use strict"; + var rkeyEvent = /^key/, rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, diff --git a/src/event/ajax.js b/src/event/ajax.js index 98e194bf0..500b36cdd 100644 --- a/src/event/ajax.js +++ b/src/event/ajax.js @@ -3,6 +3,8 @@ define( [ "../event" ], function( jQuery ) { +"use strict"; + // Attach a bunch of functions for handling common AJAX events jQuery.each( [ "ajaxStart", diff --git a/src/event/alias.js b/src/event/alias.js index b1b8f701f..863c94ad2 100644 --- a/src/event/alias.js +++ b/src/event/alias.js @@ -5,6 +5,8 @@ define( [ "./trigger" ], function( jQuery ) { +"use strict"; + jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + "change select submit keydown keypress keyup contextmenu" ).split( " " ), diff --git a/src/event/focusin.js b/src/event/focusin.js index c7af0df2c..7faef2981 100644 --- a/src/event/focusin.js +++ b/src/event/focusin.js @@ -7,6 +7,8 @@ define( [ "./trigger" ], function( jQuery, dataPriv, support ) { +"use strict"; + // Support: Firefox <=44 // Firefox doesn't have focus(in | out) events // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 diff --git a/src/event/support.js b/src/event/support.js index 1c4d416e5..e3db9ad83 100644 --- a/src/event/support.js +++ b/src/event/support.js @@ -2,6 +2,8 @@ define( [ "../var/support" ], function( support ) { +"use strict"; + support.focusin = "onfocusin" in window; return support; diff --git a/src/event/trigger.js b/src/event/trigger.js index 8f5f77845..53acadbec 100644 --- a/src/event/trigger.js +++ b/src/event/trigger.js @@ -8,6 +8,8 @@ define( [ "../event" ], function( jQuery, document, dataPriv, acceptData, hasOwn ) { +"use strict"; + var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/; jQuery.extend( jQuery.event, { diff --git a/src/exports/amd.js b/src/exports/amd.js index add6eb9bd..cbb1ef580 100644 --- a/src/exports/amd.js +++ b/src/exports/amd.js @@ -2,6 +2,8 @@ define( [ "../core" ], function( jQuery ) { +"use strict"; + // Register as a named AMD module, since jQuery can be concatenated with other // files that may use define, but not via a proper concatenation script that // understands anonymous AMD modules. A named AMD is safest and most robust diff --git a/src/exports/global.js b/src/exports/global.js index be9cbfb3a..c8d593cbb 100644 --- a/src/exports/global.js +++ b/src/exports/global.js @@ -1,3 +1,7 @@ +// This file is included in a different way from all the others +// so the "use strict" pragma is not needed. +/* jshint strict: false */ + var // Map over jQuery in case of overwrite diff --git a/src/jquery.js b/src/jquery.js index 4cc9c8a90..744a98e5d 100644 --- a/src/jquery.js +++ b/src/jquery.js @@ -33,6 +33,8 @@ define( [ "./exports/amd" ], function( jQuery ) { +"use strict"; + return ( window.jQuery = window.$ = jQuery ); } ); diff --git a/src/manipulation.js b/src/manipulation.js index a041408d7..d53eaa021 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -26,6 +26,8 @@ define( [ wrapMap, getAll, setGlobalEval, buildFragment, support, dataPriv, dataUser, acceptData, DOMEval ) { +"use strict"; + var rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi, diff --git a/src/manipulation/_evalUrl.js b/src/manipulation/_evalUrl.js index 572fe30c7..f9ec7027c 100644 --- a/src/manipulation/_evalUrl.js +++ b/src/manipulation/_evalUrl.js @@ -2,6 +2,8 @@ define( [ "../ajax" ], function( jQuery ) { +"use strict"; + jQuery._evalUrl = function( url ) { return jQuery.ajax( { url: url, diff --git a/src/manipulation/buildFragment.js b/src/manipulation/buildFragment.js index 1db3caa38..bcb508531 100644 --- a/src/manipulation/buildFragment.js +++ b/src/manipulation/buildFragment.js @@ -7,6 +7,8 @@ define( [ "./setGlobalEval" ], function( jQuery, rtagName, rscriptType, wrapMap, getAll, setGlobalEval ) { +"use strict"; + var rhtml = /<|&#?\w+;/; function buildFragment( elems, context, scripts, selection, ignored ) { diff --git a/src/manipulation/getAll.js b/src/manipulation/getAll.js index 5f3141048..85490d50e 100644 --- a/src/manipulation/getAll.js +++ b/src/manipulation/getAll.js @@ -2,6 +2,8 @@ define( [ "../core" ], function( jQuery ) { +"use strict"; + function getAll( context, tag ) { // Support: IE <=9 - 11 only diff --git a/src/manipulation/setGlobalEval.js b/src/manipulation/setGlobalEval.js index 8ca69a03a..cf95240a4 100644 --- a/src/manipulation/setGlobalEval.js +++ b/src/manipulation/setGlobalEval.js @@ -2,6 +2,8 @@ define( [ "../data/var/dataPriv" ], function( dataPriv ) { +"use strict"; + // Mark scripts as having already been evaluated function setGlobalEval( elems, refElements ) { var i = 0, diff --git a/src/manipulation/support.js b/src/manipulation/support.js index d01c439ee..4a5d9af4c 100644 --- a/src/manipulation/support.js +++ b/src/manipulation/support.js @@ -3,6 +3,8 @@ define( [ "../var/support" ], function( document, support ) { +"use strict"; + ( function() { var fragment = document.createDocumentFragment(), div = fragment.appendChild( document.createElement( "div" ) ), diff --git a/src/manipulation/var/rcheckableType.js b/src/manipulation/var/rcheckableType.js index 4c95394ac..25bbcb418 100644 --- a/src/manipulation/var/rcheckableType.js +++ b/src/manipulation/var/rcheckableType.js @@ -1,3 +1,5 @@ define( function() { + "use strict"; + return ( /^(?:checkbox|radio)$/i ); } ); diff --git a/src/manipulation/var/rscriptType.js b/src/manipulation/var/rscriptType.js index 0c77c8a58..7237c8a31 100644 --- a/src/manipulation/var/rscriptType.js +++ b/src/manipulation/var/rscriptType.js @@ -1,3 +1,5 @@ define( function() { + "use strict"; + return ( /^$|\/(?:java|ecma)script/i ); } ); diff --git a/src/manipulation/var/rtagName.js b/src/manipulation/var/rtagName.js index 1f8751ed8..d565dd3de 100644 --- a/src/manipulation/var/rtagName.js +++ b/src/manipulation/var/rtagName.js @@ -1,3 +1,5 @@ define( function() { + "use strict"; + return ( /<([a-z][^\/\0>\x20\t\r\n\f]+)/i ); } ); diff --git a/src/manipulation/wrapMap.js b/src/manipulation/wrapMap.js index 921c2eac5..1f446f7d7 100644 --- a/src/manipulation/wrapMap.js +++ b/src/manipulation/wrapMap.js @@ -1,5 +1,7 @@ define( function() { +"use strict"; + // We have to close these tags to support XHTML (#13200) var wrapMap = { diff --git a/src/offset.js b/src/offset.js index 18e6eebed..54442eb45 100644 --- a/src/offset.js +++ b/src/offset.js @@ -13,6 +13,8 @@ define( [ "./selector" // contains ], function( jQuery, access, document, documentElement, rnumnonpx, curCSS, addGetHookIf, support ) { +"use strict"; + /** * Gets a window from an element */ diff --git a/src/queue.js b/src/queue.js index 813c41cd3..3a626a2fc 100644 --- a/src/queue.js +++ b/src/queue.js @@ -5,6 +5,8 @@ define( [ "./callbacks" ], function( jQuery, dataPriv ) { +"use strict"; + jQuery.extend( { queue: function( elem, type, data ) { var queue; diff --git a/src/queue/delay.js b/src/queue/delay.js index 4def286de..d471eedc5 100644 --- a/src/queue/delay.js +++ b/src/queue/delay.js @@ -4,6 +4,8 @@ define( [ "../effects" // Delay is optional because of this dependency ], function( jQuery ) { +"use strict"; + // Based off of the plugin by Clint Helfers, with permission. // https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ jQuery.fn.delay = function( time, type ) { diff --git a/src/selector-native.js b/src/selector-native.js index 3b2525d69..da837a004 100644 --- a/src/selector-native.js +++ b/src/selector-native.js @@ -6,6 +6,8 @@ define( [ "./var/indexOf" ], function( jQuery, document, documentElement, hasOwn, indexOf ) { +"use strict"; + /* * Optional (non-Sizzle) selector module for custom builds. * diff --git a/src/selector-sizzle.js b/src/selector-sizzle.js index 1dc0ea324..ff7bc70ee 100644 --- a/src/selector-sizzle.js +++ b/src/selector-sizzle.js @@ -3,6 +3,8 @@ define( [ "../external/sizzle/dist/sizzle" ], function( jQuery, Sizzle ) { +"use strict"; + jQuery.find = Sizzle; jQuery.expr = Sizzle.selectors; diff --git a/src/serialize.js b/src/serialize.js index 5f9d6c0ae..b8742ab31 100644 --- a/src/serialize.js +++ b/src/serialize.js @@ -6,6 +6,8 @@ define( [ "./attributes/prop" ], function( jQuery, rcheckableType ) { +"use strict"; + var rbracket = /\[\]$/, rCRLF = /\r?\n/g, diff --git a/src/traversing.js b/src/traversing.js index 8525c0a5d..50cd2d6ee 100644 --- a/src/traversing.js +++ b/src/traversing.js @@ -9,6 +9,8 @@ define( [ "./selector" ], function( jQuery, indexOf, dir, siblings, rneedsContext ) { +"use strict"; + var rparentsprev = /^(?:parents|prev(?:Until|All))/, // Methods guaranteed to produce a unique set when starting from a unique set diff --git a/src/traversing/findFilter.js b/src/traversing/findFilter.js index 913034933..542852475 100644 --- a/src/traversing/findFilter.js +++ b/src/traversing/findFilter.js @@ -5,6 +5,8 @@ define( [ "../selector" ], function( jQuery, indexOf, rneedsContext ) { +"use strict"; + var risSimple = /^.[^:#\[\.,]*$/; // Implement the identical functionality for filter and not diff --git a/src/traversing/var/dir.js b/src/traversing/var/dir.js index b98fdca0e..366a823d6 100644 --- a/src/traversing/var/dir.js +++ b/src/traversing/var/dir.js @@ -2,6 +2,8 @@ define( [ "../../core" ], function( jQuery ) { +"use strict"; + return function( elem, dir, until ) { var matched = [], truncate = until !== undefined; diff --git a/src/traversing/var/rneedsContext.js b/src/traversing/var/rneedsContext.js index f57fd9de2..d0663cee8 100644 --- a/src/traversing/var/rneedsContext.js +++ b/src/traversing/var/rneedsContext.js @@ -2,5 +2,7 @@ define( [ "../../core", "../../selector" ], function( jQuery ) { + "use strict"; + return jQuery.expr.match.needsContext; } ); diff --git a/src/traversing/var/siblings.js b/src/traversing/var/siblings.js index 8a8880bf7..952629d0c 100644 --- a/src/traversing/var/siblings.js +++ b/src/traversing/var/siblings.js @@ -1,5 +1,7 @@ define( function() { +"use strict"; + return function( n, elem ) { var matched = []; diff --git a/src/var/ObjectFunctionString.js b/src/var/ObjectFunctionString.js index 570197908..f9e850fd8 100644 --- a/src/var/ObjectFunctionString.js +++ b/src/var/ObjectFunctionString.js @@ -1,5 +1,7 @@ define( [ "./fnToString" ], function( fnToString ) { + "use strict"; + return fnToString.call( Object ); } ); diff --git a/src/var/arr.js b/src/var/arr.js index 3fd364000..84713d838 100644 --- a/src/var/arr.js +++ b/src/var/arr.js @@ -1,3 +1,5 @@ define( function() { + "use strict"; + return []; } ); diff --git a/src/var/class2type.js b/src/var/class2type.js index 3a6932e11..4365d46a2 100644 --- a/src/var/class2type.js +++ b/src/var/class2type.js @@ -1,4 +1,5 @@ define( function() { + "use strict"; // [[Class]] -> type pairs return {}; diff --git a/src/var/concat.js b/src/var/concat.js index 9787bead6..e47c19d75 100644 --- a/src/var/concat.js +++ b/src/var/concat.js @@ -1,5 +1,7 @@ define( [ "./arr" ], function( arr ) { + "use strict"; + return arr.concat; } ); diff --git a/src/var/document.js b/src/var/document.js index bb9428484..dd3939df4 100644 --- a/src/var/document.js +++ b/src/var/document.js @@ -1,3 +1,5 @@ define( function() { + "use strict"; + return window.document; } ); diff --git a/src/var/documentElement.js b/src/var/documentElement.js index e0c0aea6b..0e3f8b48c 100644 --- a/src/var/documentElement.js +++ b/src/var/documentElement.js @@ -1,5 +1,7 @@ define( [ "./document" ], function( document ) { + "use strict"; + return document.documentElement; } ); diff --git a/src/var/fnToString.js b/src/var/fnToString.js index a92e6ebb4..18c43ff30 100644 --- a/src/var/fnToString.js +++ b/src/var/fnToString.js @@ -1,5 +1,7 @@ define( [ "./hasOwn" ], function( hasOwn ) { + "use strict"; + return hasOwn.toString; } ); diff --git a/src/var/getProto.js b/src/var/getProto.js index dccf3040a..965fab8fb 100644 --- a/src/var/getProto.js +++ b/src/var/getProto.js @@ -1,3 +1,5 @@ define( function() { + "use strict"; + return Object.getPrototypeOf; } ); diff --git a/src/var/hasOwn.js b/src/var/hasOwn.js index 92f323e04..44ab6807d 100644 --- a/src/var/hasOwn.js +++ b/src/var/hasOwn.js @@ -1,5 +1,7 @@ define( [ "./class2type" ], function( class2type ) { + "use strict"; + return class2type.hasOwnProperty; } ); diff --git a/src/var/indexOf.js b/src/var/indexOf.js index 5283841b2..8320b98e5 100644 --- a/src/var/indexOf.js +++ b/src/var/indexOf.js @@ -1,5 +1,7 @@ define( [ "./arr" ], function( arr ) { + "use strict"; + return arr.indexOf; } ); diff --git a/src/var/pnum.js b/src/var/pnum.js index 7fd9f6677..6f06d73b1 100644 --- a/src/var/pnum.js +++ b/src/var/pnum.js @@ -1,3 +1,5 @@ define( function() { + "use strict"; + return ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; } ); diff --git a/src/var/push.js b/src/var/push.js index bca1a58ed..94656209a 100644 --- a/src/var/push.js +++ b/src/var/push.js @@ -1,5 +1,7 @@ define( [ "./arr" ], function( arr ) { + "use strict"; + return arr.push; } ); diff --git a/src/var/rcssNum.js b/src/var/rcssNum.js index 408f5e26d..4214b14aa 100644 --- a/src/var/rcssNum.js +++ b/src/var/rcssNum.js @@ -2,6 +2,8 @@ define( [ "../var/pnum" ], function( pnum ) { +"use strict"; + return new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); } ); diff --git a/src/var/rnotwhite.js b/src/var/rnotwhite.js index 6067728ee..91bdec22f 100644 --- a/src/var/rnotwhite.js +++ b/src/var/rnotwhite.js @@ -1,3 +1,5 @@ define( function() { + "use strict"; + return ( /\S+/g ); } ); diff --git a/src/var/slice.js b/src/var/slice.js index d8206d30a..915f837be 100644 --- a/src/var/slice.js +++ b/src/var/slice.js @@ -1,5 +1,7 @@ define( [ "./arr" ], function( arr ) { + "use strict"; + return arr.slice; } ); diff --git a/src/var/support.js b/src/var/support.js index 3db9b67bc..094d0aece 100644 --- a/src/var/support.js +++ b/src/var/support.js @@ -1,4 +1,5 @@ define( function() { + "use strict"; // All support tests are defined in their respective modules. return {}; diff --git a/src/var/toString.js b/src/var/toString.js index 80ac7f13f..ff4ecdc72 100644 --- a/src/var/toString.js +++ b/src/var/toString.js @@ -1,5 +1,7 @@ define( [ "./class2type" ], function( class2type ) { + "use strict"; + return class2type.toString; } ); diff --git a/src/wrap.js b/src/wrap.js index 69c7cbf23..88b9bb56d 100644 --- a/src/wrap.js +++ b/src/wrap.js @@ -5,6 +5,8 @@ define( [ "./traversing" // parent, contents ], function( jQuery ) { +"use strict"; + jQuery.fn.extend( { wrapAll: function( html ) { var wrap; diff --git a/src/wrapper.js b/src/wrapper.js index 8866d6bcd..5f07c059a 100644 --- a/src/wrapper.js +++ b/src/wrapper.js @@ -14,6 +14,8 @@ */ ( function( global, factory ) { + "use strict"; + if ( typeof module === "object" && typeof module.exports === "object" ) { // For CommonJS and CommonJS-like environments where a proper `window` -- 2.39.5