diff options
author | Michał Gołębiowski <m.goleb@gmail.com> | 2015-06-17 12:55:59 +0200 |
---|---|---|
committer | Michał Gołębiowski <m.goleb@gmail.com> | 2015-06-17 12:59:01 +0200 |
commit | 842958e7aecd0d75a7ee9e2aaec83457701aa2f3 (patch) | |
tree | d9adb6f9644eee28f71ea233b18f2d60559c9ebc /src/ajax.js | |
parent | 219c7494938a10b985b7827990bc419e41585b10 (diff) | |
download | jquery-842958e7aecd0d75a7ee9e2aaec83457701aa2f3.tar.gz jquery-842958e7aecd0d75a7ee9e2aaec83457701aa2f3.zip |
Core: Switch from modules to just window.setTimeout etc.
Using modules for window.setTimeout etc. made those functions cached and
disabled Sinon mocking, making effects tests fail. Just writing
window.setTimeout directly is smaller anyway.
Diffstat (limited to 'src/ajax.js')
-rw-r--r-- | src/ajax.js | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/ajax.js b/src/ajax.js index 21668165e..9c1d6ca85 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -2,8 +2,6 @@ define([ "./core", "./var/document", "./var/rnotwhite", - "./var/setTimeout", - "./var/clearTimeout", "./ajax/var/location", "./ajax/var/nonce", "./ajax/var/rquery", @@ -11,8 +9,7 @@ define([ "./ajax/parseJSON", "./ajax/parseXML", "./deferred" -], function( jQuery, document, rnotwhite, setTimeout, clearTimeout, - location, nonce, rquery ) { +], function( jQuery, document, rnotwhite, location, nonce, rquery ) { var rhash = /#.*$/, @@ -645,7 +642,7 @@ jQuery.extend({ // Timeout if ( s.async && s.timeout > 0 ) { - timeoutTimer = setTimeout(function() { + timeoutTimer = window.setTimeout(function() { jqXHR.abort("timeout"); }, s.timeout ); } @@ -679,7 +676,7 @@ jQuery.extend({ // Clear timeout if it exists if ( timeoutTimer ) { - clearTimeout( timeoutTimer ); + window.clearTimeout( timeoutTimer ); } // Dereference transport for early garbage collection |