You've already forked codtracker-js
format: prettify entire project
This commit is contained in:
62
node_modules/process-nextick-args/index.js
generated
vendored
62
node_modules/process-nextick-args/index.js
generated
vendored
@ -1,12 +1,15 @@
|
||||
'use strict';
|
||||
|
||||
if (typeof process === 'undefined' ||
|
||||
!process.version ||
|
||||
process.version.indexOf('v0.') === 0 ||
|
||||
process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {
|
||||
if (
|
||||
typeof process === 'undefined' ||
|
||||
!process.version ||
|
||||
process.version.indexOf('v0.') === 0 ||
|
||||
(process.version.indexOf('v1.') === 0 &&
|
||||
process.version.indexOf('v1.8.') !== 0)
|
||||
) {
|
||||
module.exports = { nextTick: nextTick };
|
||||
} else {
|
||||
module.exports = process
|
||||
module.exports = process;
|
||||
}
|
||||
|
||||
function nextTick(fn, arg1, arg2, arg3) {
|
||||
@ -16,30 +19,29 @@ function nextTick(fn, arg1, arg2, arg3) {
|
||||
var len = arguments.length;
|
||||
var args, i;
|
||||
switch (len) {
|
||||
case 0:
|
||||
case 1:
|
||||
return process.nextTick(fn);
|
||||
case 2:
|
||||
return process.nextTick(function afterTickOne() {
|
||||
fn.call(null, arg1);
|
||||
});
|
||||
case 3:
|
||||
return process.nextTick(function afterTickTwo() {
|
||||
fn.call(null, arg1, arg2);
|
||||
});
|
||||
case 4:
|
||||
return process.nextTick(function afterTickThree() {
|
||||
fn.call(null, arg1, arg2, arg3);
|
||||
});
|
||||
default:
|
||||
args = new Array(len - 1);
|
||||
i = 0;
|
||||
while (i < args.length) {
|
||||
args[i++] = arguments[i];
|
||||
}
|
||||
return process.nextTick(function afterTick() {
|
||||
fn.apply(null, args);
|
||||
});
|
||||
case 0:
|
||||
case 1:
|
||||
return process.nextTick(fn);
|
||||
case 2:
|
||||
return process.nextTick(function afterTickOne() {
|
||||
fn.call(null, arg1);
|
||||
});
|
||||
case 3:
|
||||
return process.nextTick(function afterTickTwo() {
|
||||
fn.call(null, arg1, arg2);
|
||||
});
|
||||
case 4:
|
||||
return process.nextTick(function afterTickThree() {
|
||||
fn.call(null, arg1, arg2, arg3);
|
||||
});
|
||||
default:
|
||||
args = new Array(len - 1);
|
||||
i = 0;
|
||||
while (i < args.length) {
|
||||
args[i++] = arguments[i];
|
||||
}
|
||||
return process.nextTick(function afterTick() {
|
||||
fn.apply(null, args);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user