]> source.dussan.org Git - jquery.git/commitdiff
Core: Use window.setTimeout & friends instead of global equivalents 2397/head
authorMichał Gołębiowski <m.goleb@gmail.com>
Sun, 14 Jun 2015 17:21:57 +0000 (19:21 +0200)
committerMichał Gołębiowski <m.goleb@gmail.com>
Wed, 17 Jun 2015 10:29:49 +0000 (12:29 +0200)
Fixes gh-2177

src/.jshintrc
src/ajax.js
src/core/ready.js
src/deferred.js
src/effects.js
src/queue/delay.js
src/var/clearInterval.js [new file with mode: 0644]
src/var/clearTimeout.js [new file with mode: 0644]
src/var/setInterval.js [new file with mode: 0644]
src/var/setTimeout.js [new file with mode: 0644]

index a48233b29ee49246637e1544c46ff9dbe6ecd557..6144bf420efba9a8ddac7f8ab336bcf5b8d74ad6 100644 (file)
 
        "globals": {
                "window": true,
-               "setTimeout": true,
-               "clearTimeout": true,
-               "setInterval": true,
-               "clearInterval": true,
 
                "jQuery": true,
                "define": true,
index 70bb49691a592e2f55973dbc76efd305cb0fa939..21668165e6962d320ac4c30c52264193b6fb993b 100644 (file)
@@ -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 = /#.*$/,
index bea0496da1edc2297f8088d3d53352bb7a8884db..b78b474cdb8671a0784159d10fefc8fdfde2c0e5 100644 (file)
@@ -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;
index cdb7f1cc4e7c9efbc2f0c519892f822e72f249fd..043bf0c04d5e81e0400811e24e596daced0f8bdd 100644 (file)
@@ -1,8 +1,9 @@
 define([
        "./core",
        "./var/slice",
+       "./var/setTimeout",
        "./callbacks"
-], function( jQuery, slice ) {
+], function( jQuery, slice, setTimeout ) {
 
 function Identity( v ) {
        return v;
index 3268fcda9a380a206b5608fdd9a691b89d604339..63874fe78e8c8a93f0b47ca963cd5ca3d2db6d5d 100644 (file)
@@ -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,
index 037ef0998e345dc9e50f05cc22902226577ff2dd..d2aa7e4092fd9ac712e942a0f079b8b6798421f7 100644 (file)
@@ -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/
diff --git a/src/var/clearInterval.js b/src/var/clearInterval.js
new file mode 100644 (file)
index 0000000..b8fcf31
--- /dev/null
@@ -0,0 +1,3 @@
+define(function() {
+       return window.clearInterval;
+});
diff --git a/src/var/clearTimeout.js b/src/var/clearTimeout.js
new file mode 100644 (file)
index 0000000..ab77b07
--- /dev/null
@@ -0,0 +1,3 @@
+define(function() {
+       return window.clearTimeout;
+});
diff --git a/src/var/setInterval.js b/src/var/setInterval.js
new file mode 100644 (file)
index 0000000..7d9906b
--- /dev/null
@@ -0,0 +1,3 @@
+define(function() {
+       return window.setInterval;
+});
diff --git a/src/var/setTimeout.js b/src/var/setTimeout.js
new file mode 100644 (file)
index 0000000..cda6b55
--- /dev/null
@@ -0,0 +1,3 @@
+define(function() {
+       return window.setTimeout;
+});