Version 1
[yaffs-website] / node_modules / core-js / library / modules / web.timers.js
1 // ie9- setTimeout & setInterval additional parameters fix
2 var global     = require('./_global')
3   , $export    = require('./_export')
4   , invoke     = require('./_invoke')
5   , partial    = require('./_partial')
6   , navigator  = global.navigator
7   , MSIE       = !!navigator && /MSIE .\./.test(navigator.userAgent); // <- dirty ie9- check
8 var wrap = function(set){
9   return MSIE ? function(fn, time /*, ...args */){
10     return set(invoke(
11       partial,
12       [].slice.call(arguments, 2),
13       typeof fn == 'function' ? fn : Function(fn)
14     ), time);
15   } : set;
16 };
17 $export($export.G + $export.B + $export.F * MSIE, {
18   setTimeout:  wrap(global.setTimeout),
19   setInterval: wrap(global.setInterval)
20 });