Permalink
Browse files

Core: Use window.setTimeout & friends instead of global equivalents

Fixes gh-2177
  • Loading branch information...
mgol committed Jun 14, 2015
1 parent b041242 commit 219c7494938a10b985b7827990bc419e41585b10
Showing with 28 additions and 9 deletions.
  1. +0 −4 src/.jshintrc
  2. +4 −1 src/ajax.js
  3. +2 −1 src/core/ready.js
  4. +2 −1 src/deferred.js
  5. +5 −1 src/effects.js
  6. +3 −1 src/queue/delay.js
  7. +3 −0 src/var/clearInterval.js
  8. +3 −0 src/var/clearTimeout.js
  9. +3 −0 src/var/setInterval.js
  10. +3 −0 src/var/setTimeout.js
View
@@ -14,10 +14,6 @@
"globals": {
"window": true,
"setTimeout": true,
"clearTimeout": true,
"setInterval": true,
"clearInterval": true,
"jQuery": true,
"define": true,
View
@@ -2,14 +2,17 @@ define([
"./core",
"./var/document",
"./var/rnotwhite",
"./var/setTimeout",
"./var/clearTimeout",
"./ajax/var/location",
"./ajax/var/nonce",
"./ajax/var/rquery",
"./core/init",
"./ajax/parseJSON",
"./ajax/parseXML",
"./deferred"
], function( jQuery, document, rnotwhite, location, nonce, rquery ) {
], function( jQuery, document, rnotwhite, setTimeout, clearTimeout,
location, nonce, rquery ) {
var
rhash = /#.*$/,
View
@@ -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;
View
@@ -1,8 +1,9 @@
define([
"./core",
"./var/slice",
"./var/setTimeout",
"./callbacks"
], function( jQuery, slice ) {
], function( jQuery, slice, setTimeout ) {
function Identity( v ) {
return v;
View
@@ -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,
View
@@ -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/
View
@@ -0,0 +1,3 @@
define(function() {
return window.clearInterval;
});
View
@@ -0,0 +1,3 @@
define(function() {
return window.clearTimeout;
});
View
@@ -0,0 +1,3 @@
define(function() {
return window.setInterval;
});
View
@@ -0,0 +1,3 @@
define(function() {
return window.setTimeout;
});

0 comments on commit 219c749

Please sign in to comment.