mirror of
https://github.com/jquery/jquery.git
synced 2026-02-01 06:04:57 -05:00
Core: Use window.setTimeout & friends instead of global equivalents
Fixes gh-2177
This commit is contained in:
@@ -14,10 +14,6 @@
|
||||
|
||||
"globals": {
|
||||
"window": true,
|
||||
"setTimeout": true,
|
||||
"clearTimeout": true,
|
||||
"setInterval": true,
|
||||
"clearInterval": true,
|
||||
|
||||
"jQuery": true,
|
||||
"define": true,
|
||||
|
||||
@@ -2,6 +2,8 @@ define([
|
||||
"./core",
|
||||
"./var/document",
|
||||
"./var/rnotwhite",
|
||||
"./var/setTimeout",
|
||||
"./var/clearTimeout",
|
||||
"./ajax/var/location",
|
||||
"./ajax/var/nonce",
|
||||
"./ajax/var/rquery",
|
||||
@@ -9,7 +11,8 @@ define([
|
||||
"./ajax/parseJSON",
|
||||
"./ajax/parseXML",
|
||||
"./deferred"
|
||||
], function( jQuery, document, rnotwhite, location, nonce, rquery ) {
|
||||
], function( jQuery, document, rnotwhite, setTimeout, clearTimeout,
|
||||
location, nonce, rquery ) {
|
||||
|
||||
var
|
||||
rhash = /#.*$/,
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
define([
|
||||
"../core",
|
||||
"../var/document",
|
||||
"../var/setTimeout",
|
||||
"../deferred"
|
||||
], function( jQuery, document ) {
|
||||
], function( jQuery, document, setTimeout ) {
|
||||
|
||||
// The deferred used on DOM ready
|
||||
var readyList;
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
define([
|
||||
"./core",
|
||||
"./var/slice",
|
||||
"./var/setTimeout",
|
||||
"./callbacks"
|
||||
], function( jQuery, slice ) {
|
||||
], function( jQuery, slice, setTimeout ) {
|
||||
|
||||
function Identity( v ) {
|
||||
return v;
|
||||
|
||||
6
src/effects.js
vendored
6
src/effects.js
vendored
@@ -2,6 +2,9 @@ define([
|
||||
"./core",
|
||||
"./var/document",
|
||||
"./var/rcssNum",
|
||||
"./var/setInterval",
|
||||
"./var/clearInterval",
|
||||
"./var/setTimeout",
|
||||
"./css/var/cssExpand",
|
||||
"./css/var/isHidden",
|
||||
"./css/var/swap",
|
||||
@@ -16,7 +19,8 @@ define([
|
||||
"./manipulation",
|
||||
"./css",
|
||||
"./effects/Tween"
|
||||
], function( jQuery, document, rcssNum, cssExpand, isHidden, swap, adjustCSS, dataPriv, showHide ) {
|
||||
], function( jQuery, document, rcssNum, setInterval, clearInterval, setTimeout,
|
||||
cssExpand, isHidden, swap, adjustCSS, dataPriv, showHide ) {
|
||||
|
||||
var
|
||||
fxNow, timerId,
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
define([
|
||||
"../core",
|
||||
"../var/setTimeout",
|
||||
"../var/clearTimeout",
|
||||
"../queue",
|
||||
"../effects" // Delay is optional because of this dependency
|
||||
], function( jQuery ) {
|
||||
], function( jQuery, setTimeout, clearTimeout ) {
|
||||
|
||||
// Based off of the plugin by Clint Helfers, with permission.
|
||||
// http://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/
|
||||
|
||||
3
src/var/clearInterval.js
Normal file
3
src/var/clearInterval.js
Normal file
@@ -0,0 +1,3 @@
|
||||
define(function() {
|
||||
return window.clearInterval;
|
||||
});
|
||||
3
src/var/clearTimeout.js
Normal file
3
src/var/clearTimeout.js
Normal file
@@ -0,0 +1,3 @@
|
||||
define(function() {
|
||||
return window.clearTimeout;
|
||||
});
|
||||
3
src/var/setInterval.js
Normal file
3
src/var/setInterval.js
Normal file
@@ -0,0 +1,3 @@
|
||||
define(function() {
|
||||
return window.setInterval;
|
||||
});
|
||||
3
src/var/setTimeout.js
Normal file
3
src/var/setTimeout.js
Normal file
@@ -0,0 +1,3 @@
|
||||
define(function() {
|
||||
return window.setTimeout;
|
||||
});
|
||||
Reference in New Issue
Block a user