Build: Put all AMD modules in "src/" in strict mode

Fixes gh-3073
This commit is contained in:
Michał Gołębiowski
2016-04-25 20:25:08 +02:00
parent e2d1142c2e
commit 305f193aa5
99 changed files with 195 additions and 0 deletions

View File

@@ -7,6 +7,7 @@
"immed": true,
"noarg": true,
"quotmark": "double",
"strict": true,
"undef": true,
"unused": true,

View File

@@ -13,6 +13,8 @@ define( [
"./serialize" // jQuery.param
], function( jQuery, document, rnotwhite, location, nonce, rquery ) {
"use strict";
var
r20 = /%20/g,
rhash = /#.*$/,

View File

@@ -5,6 +5,8 @@ define( [
"../ajax"
], function( jQuery, nonce, rquery ) {
"use strict";
var oldCallbacks = [],
rjsonp = /(=)\?(?=&|$)|\?\?/;

View File

@@ -7,6 +7,8 @@ define( [
"../selector"
], function( jQuery ) {
"use strict";
/**
* Load a url into a page
*/

View File

@@ -2,6 +2,8 @@ define( [
"../core"
], function( jQuery ) {
"use strict";
// Cross-browser xml parsing
jQuery.parseXML = function( data ) {
var xml;

View File

@@ -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 ) {

View File

@@ -1,3 +1,5 @@
define( function() {
"use strict";
return window.location;
} );

View File

@@ -1,5 +1,7 @@
define( [
"../../core"
], function( jQuery ) {
"use strict";
return jQuery.now();
} );

View File

@@ -1,3 +1,5 @@
define( function() {
"use strict";
return ( /\?/ );
} );

View File

@@ -4,6 +4,8 @@ define( [
"../ajax"
], function( jQuery, support ) {
"use strict";
jQuery.ajaxSettings.xhr = function() {
try {
return new window.XMLHttpRequest();

View File

@@ -6,6 +6,8 @@ define( [
"./attributes/val"
], function( jQuery ) {
"use strict";
// Return jQuery for attributes-only inclusion
return jQuery;
} );

View File

@@ -6,6 +6,8 @@ define( [
"../selector"
], function( jQuery, access, support, rnotwhite ) {
"use strict";
var boolHook,
attrHandle = jQuery.expr.attrHandle;

View File

@@ -5,6 +5,8 @@ define( [
"../core/init"
], function( jQuery, rnotwhite, dataPriv ) {
"use strict";
var rclass = /[\t\r\n\f]/g;
function getClass( elem ) {

View File

@@ -5,6 +5,8 @@ define( [
"../selector"
], function( jQuery, access, support ) {
"use strict";
var rfocusable = /^(?:input|select|textarea|button)$/i,
rclickable = /^(?:a|area)$/i;

View File

@@ -3,6 +3,8 @@ define( [
"../var/support"
], function( document, support ) {
"use strict";
( function() {
var input = document.createElement( "input" ),
select = document.createElement( "select" ),

View File

@@ -4,6 +4,8 @@ define( [
"../core/init"
], function( jQuery, support ) {
"use strict";
var rreturn = /\r/g,
rspaces = /[\x20\t\r\n\f]+/g;

View File

@@ -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 = {};

View File

@@ -17,6 +17,8 @@ define( [
class2type, toString, hasOwn, fnToString, ObjectFunctionString,
support, DOMEval ) {
"use strict";
var
version = "@VERSION",

View File

@@ -1,6 +1,8 @@
define( [
"../var/document"
], function( document ) {
"use strict";
function DOMEval( code, doc ) {
doc = doc || document;

View File

@@ -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 ) {

View File

@@ -6,6 +6,8 @@ define( [
"../traversing/findFilter"
], function( jQuery, document, rsingleTag ) {
"use strict";
// A central reference to the root jQuery(document)
var rootjQuery,

View File

@@ -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

View File

@@ -3,6 +3,8 @@ define( [
"../var/document"
], function( jQuery, document ) {
"use strict";
var readyCallbacks = [],
readyFiring = false,
whenReady = function( fn ) {

View File

@@ -4,6 +4,8 @@ define( [
"../deferred"
], function( jQuery, document ) {
"use strict";
// The deferred used on DOM ready
var readyList = jQuery.Deferred();

View File

@@ -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.

View File

@@ -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 );

View File

@@ -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

View File

@@ -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.

View File

@@ -3,6 +3,8 @@ define( [
"../var/rcssNum"
], function( jQuery, rcssNum ) {
"use strict";
function adjustCSS( elem, prop, valueParts, tween ) {
var adjusted,
scale = 1,

View File

@@ -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;

View File

@@ -3,6 +3,8 @@ define( [
"../selector"
], function( jQuery ) {
"use strict";
jQuery.expr.pseudos.hidden = function( elem ) {
return !jQuery.expr.pseudos.visible( elem );
};

View File

@@ -4,6 +4,8 @@ define( [
"../css/var/isHiddenWithinTree"
], function( jQuery, dataPriv, isHiddenWithinTree ) {
"use strict";
var defaultDisplayMap = {};
function getDefaultDisplay( elem ) {

View File

@@ -5,6 +5,8 @@ define( [
"../var/support"
], function( jQuery, document, documentElement, support ) {
"use strict";
( function() {
// Executing both pixelPosition & boxSizingReliable tests require only one layout

View File

@@ -1,3 +1,5 @@
define( function() {
"use strict";
return [ "Top", "Right", "Bottom", "Left" ];
} );

View File

@@ -1,4 +1,6 @@
define( function() {
"use strict";
return function( elem ) {
// Support: IE <=11 only, Firefox <=30 (#15098, #14150)

View File

@@ -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.

View File

@@ -1,3 +1,5 @@
define( function() {
"use strict";
return ( /^margin/ );
} );

View File

@@ -1,5 +1,7 @@
define( [
"../../var/pnum"
], function( pnum ) {
"use strict";
return new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
} );

View File

@@ -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,

View File

@@ -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

View File

@@ -4,6 +4,8 @@ define( [
"./var/acceptData"
], function( jQuery, rnotwhite, acceptData ) {
"use strict";
function Data() {
this.expando = jQuery.expando + Data.uid++;
}

View File

@@ -1,5 +1,7 @@
define( function() {
"use strict";
/**
* Determines whether an object can have data
*/

View File

@@ -1,5 +1,7 @@
define( [
"../Data"
], function( Data ) {
"use strict";
return new Data();
} );

View File

@@ -1,5 +1,7 @@
define( [
"../Data"
], function( Data ) {
"use strict";
return new Data();
} );

View File

@@ -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$/;

View File

@@ -2,6 +2,8 @@ define( [
"./core"
], function( jQuery ) {
"use strict";
jQuery.fn.extend( {
bind: function( types, data, fn ) {

View File

@@ -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 },

2
src/effects.js vendored
View File

@@ -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)$/,

View File

@@ -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 );
}

View File

@@ -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;

View File

@@ -9,6 +9,8 @@ define( [
"./selector"
], function( jQuery, document, rnotwhite, slice, dataPriv ) {
"use strict";
var
rkeyEvent = /^key/,
rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,

View File

@@ -3,6 +3,8 @@ define( [
"../event"
], function( jQuery ) {
"use strict";
// Attach a bunch of functions for handling common AJAX events
jQuery.each( [
"ajaxStart",

View File

@@ -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( " " ),

View File

@@ -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

View File

@@ -2,6 +2,8 @@ define( [
"../var/support"
], function( support ) {
"use strict";
support.focusin = "onfocusin" in window;
return support;

View File

@@ -8,6 +8,8 @@ define( [
"../event"
], function( jQuery, document, dataPriv, acceptData, hasOwn ) {
"use strict";
var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/;
jQuery.extend( jQuery.event, {

View File

@@ -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

View File

@@ -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

2
src/jquery.js vendored
View File

@@ -33,6 +33,8 @@ define( [
"./exports/amd"
], function( jQuery ) {
"use strict";
return ( window.jQuery = window.$ = jQuery );
} );

View File

@@ -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,

View File

@@ -2,6 +2,8 @@ define( [
"../ajax"
], function( jQuery ) {
"use strict";
jQuery._evalUrl = function( url ) {
return jQuery.ajax( {
url: url,

View File

@@ -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 ) {

View File

@@ -2,6 +2,8 @@ define( [
"../core"
], function( jQuery ) {
"use strict";
function getAll( context, tag ) {
// Support: IE <=9 - 11 only

View File

@@ -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,

View File

@@ -3,6 +3,8 @@ define( [
"../var/support"
], function( document, support ) {
"use strict";
( function() {
var fragment = document.createDocumentFragment(),
div = fragment.appendChild( document.createElement( "div" ) ),

View File

@@ -1,3 +1,5 @@
define( function() {
"use strict";
return ( /^(?:checkbox|radio)$/i );
} );

View File

@@ -1,3 +1,5 @@
define( function() {
"use strict";
return ( /^$|\/(?:java|ecma)script/i );
} );

View File

@@ -1,3 +1,5 @@
define( function() {
"use strict";
return ( /<([a-z][^\/\0>\x20\t\r\n\f]+)/i );
} );

View File

@@ -1,5 +1,7 @@
define( function() {
"use strict";
// We have to close these tags to support XHTML (#13200)
var wrapMap = {

View File

@@ -13,6 +13,8 @@ define( [
"./selector" // contains
], function( jQuery, access, document, documentElement, rnumnonpx, curCSS, addGetHookIf, support ) {
"use strict";
/**
* Gets a window from an element
*/

View File

@@ -5,6 +5,8 @@ define( [
"./callbacks"
], function( jQuery, dataPriv ) {
"use strict";
jQuery.extend( {
queue: function( elem, type, data ) {
var queue;

View File

@@ -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 ) {

View File

@@ -6,6 +6,8 @@ define( [
"./var/indexOf"
], function( jQuery, document, documentElement, hasOwn, indexOf ) {
"use strict";
/*
* Optional (non-Sizzle) selector module for custom builds.
*

View File

@@ -3,6 +3,8 @@ define( [
"../external/sizzle/dist/sizzle"
], function( jQuery, Sizzle ) {
"use strict";
jQuery.find = Sizzle;
jQuery.expr = Sizzle.selectors;

View File

@@ -6,6 +6,8 @@ define( [
"./attributes/prop"
], function( jQuery, rcheckableType ) {
"use strict";
var
rbracket = /\[\]$/,
rCRLF = /\r?\n/g,

View File

@@ -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

View File

@@ -5,6 +5,8 @@ define( [
"../selector"
], function( jQuery, indexOf, rneedsContext ) {
"use strict";
var risSimple = /^.[^:#\[\.,]*$/;
// Implement the identical functionality for filter and not

View File

@@ -2,6 +2,8 @@ define( [
"../../core"
], function( jQuery ) {
"use strict";
return function( elem, dir, until ) {
var matched = [],
truncate = until !== undefined;

View File

@@ -2,5 +2,7 @@ define( [
"../../core",
"../../selector"
], function( jQuery ) {
"use strict";
return jQuery.expr.match.needsContext;
} );

View File

@@ -1,5 +1,7 @@
define( function() {
"use strict";
return function( n, elem ) {
var matched = [];

View File

@@ -1,5 +1,7 @@
define( [
"./fnToString"
], function( fnToString ) {
"use strict";
return fnToString.call( Object );
} );

View File

@@ -1,3 +1,5 @@
define( function() {
"use strict";
return [];
} );

View File

@@ -1,4 +1,5 @@
define( function() {
"use strict";
// [[Class]] -> type pairs
return {};

View File

@@ -1,5 +1,7 @@
define( [
"./arr"
], function( arr ) {
"use strict";
return arr.concat;
} );

View File

@@ -1,3 +1,5 @@
define( function() {
"use strict";
return window.document;
} );

View File

@@ -1,5 +1,7 @@
define( [
"./document"
], function( document ) {
"use strict";
return document.documentElement;
} );

View File

@@ -1,5 +1,7 @@
define( [
"./hasOwn"
], function( hasOwn ) {
"use strict";
return hasOwn.toString;
} );

View File

@@ -1,3 +1,5 @@
define( function() {
"use strict";
return Object.getPrototypeOf;
} );

View File

@@ -1,5 +1,7 @@
define( [
"./class2type"
], function( class2type ) {
"use strict";
return class2type.hasOwnProperty;
} );

View File

@@ -1,5 +1,7 @@
define( [
"./arr"
], function( arr ) {
"use strict";
return arr.indexOf;
} );

View File

@@ -1,3 +1,5 @@
define( function() {
"use strict";
return ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;
} );

View File

@@ -1,5 +1,7 @@
define( [
"./arr"
], function( arr ) {
"use strict";
return arr.push;
} );

View File

@@ -2,6 +2,8 @@ define( [
"../var/pnum"
], function( pnum ) {
"use strict";
return new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );
} );

View File

@@ -1,3 +1,5 @@
define( function() {
"use strict";
return ( /\S+/g );
} );

View File

@@ -1,5 +1,7 @@
define( [
"./arr"
], function( arr ) {
"use strict";
return arr.slice;
} );

View File

@@ -1,4 +1,5 @@
define( function() {
"use strict";
// All support tests are defined in their respective modules.
return {};

View File

@@ -1,5 +1,7 @@
define( [
"./class2type"
], function( class2type ) {
"use strict";
return class2type.toString;
} );

View File

@@ -5,6 +5,8 @@ define( [
"./traversing" // parent, contents
], function( jQuery ) {
"use strict";
jQuery.fn.extend( {
wrapAll: function( html ) {
var wrap;

View File

@@ -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`