, " " " -".
: , "foo", - , , " 1\nLine2" " 2\nLine1"?
var t1 = asyncTestCapture();
foo(function() {
console.log("Line 1");
});
console.log("Line 2");
var out12vsOut21 = asyncTestVerify(t1);
β1: (Array forEach, map .., String replacer, JSON reviver)
β 2: ( , node.js , , "out12vsOut21". , node)
function asyncTestCapture() {
return {
activeHandles: process._getActiveHandles(),
activeRequests: process._getActiveRequests()
};
}
function asyncTestVerify(handles1) {
var handles2 = asyncTestCapture();
return handles2.activeHandles === handles1.activeHandles && handles2.activeRequests === handles1.activeRequests
}
: , - . "out12vsOut21", , "async not foo is"