massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / core-js / modules / web.timers.js
index 61125cc76e1435a513b2bf1ecc9a674bf2d86910..e27affab24eeba2b6643e3eaf8944f613c92e3fc 100644 (file)
@@ -1,17 +1,19 @@
 var $ = require('../internals/export');
 var global = require('../internals/global');
+var apply = require('../internals/function-apply');
+var isCallable = require('../internals/is-callable');
 var userAgent = require('../internals/engine-user-agent');
+var arraySlice = require('../internals/array-slice');
 
-var slice = [].slice;
 var MSIE = /MSIE .\./.test(userAgent); // <- dirty ie9- check
+var Function = global.Function;
 
 var wrap = function (scheduler) {
   return function (handler, timeout /* , ...arguments */) {
     var boundArgs = arguments.length > 2;
-    var args = boundArgs ? slice.call(arguments, 2) : undefined;
+    var args = boundArgs ? arraySlice(arguments, 2) : undefined;
     return scheduler(boundArgs ? function () {
-      // eslint-disable-next-line no-new-func -- spec requirement
-      (typeof handler == 'function' ? handler : Function(handler)).apply(this, args);
+      apply(isCallable(handler) ? handler : Function(handler), this, args);
     } : handler, timeout);
   };
 };