From ca28f9bed802c77b1bebe6fda50bd7e20753c1eb Mon Sep 17 00:00:00 2001 From: Benjamin Gruenbaum Date: Fri, 13 Feb 2015 16:00:17 +0200 Subject: [PATCH] domain test with node failed --- .DS_Store | Bin 0 -> 8196 bytes nodetest.js | 7 +++++++ q.js | 6 +++--- 3 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 .DS_Store create mode 100644 nodetest.js diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..8f03eba6592247cee61edaf14e2cce07b7bb086c GIT binary patch literal 8196 zcmeHM&2G~`5T0$*)@hIk0;Eb@d<3bgiqb0AG;M%Lv{X%Lg(wPfoF=BOZ4##`sv_mg z6L9ALF^~|PcmQ|)1aMr} zSsk(v%0VClIEesGBD5^R3`I!m!0A$*L?Mu>RSYNw#u?z;JxvBR$f0^Pe|PJK?Hahs zH`G1U+vl>NM>J3C^nliAi|$j2Dzt>W-z?iP%#RVwRbUj2XM)M{T%@st^rY;!p=@1qevqUe(a2!z- zH%AW>N~r`SvZ-Z&kB5x7&>qK(}j7W6$bXhGkp+ zD=p2RYIfo5ESFnd)N?EO{-S=C&o3|PE4h5XpZ%g~x9+U2Z9eh(uiw6V|Ka1O&tJdE zZ9pPCSBW18(efQ%hJ>6{+K%lyO^mUAhW4;vJJ|eXd21&=2;_1PmqAD%!`1m8rCIeA z1CwT8Ixx7v`G4v1-~T7=ma?Z9Pz+3v0g>9MY!qSe;vHbrHXqeG>T^^stTzaxgrJe9 jIiyU-A%}k$qOU`hF@;bL0*Mh6^&%i?P>o_>q73{6#+^O* literal 0 HcmV?d00001 diff --git a/nodetest.js b/nodetest.js new file mode 100644 index 00000000..d0217600 --- /dev/null +++ b/nodetest.js @@ -0,0 +1,7 @@ +var q = require("./q/index.js"); + +q.reject("Heh"); + +process.on("unhandledRejection", function(handler, reason){ + console.log("Found it!", handler, reason); +}); \ No newline at end of file diff --git a/q.js b/q.js index 59bf6faa..aa3fbcc4 100644 --- a/q.js +++ b/q.js @@ -107,7 +107,7 @@ var nextTick =(function () { head.domain = void 0; domain.enter(); } - runSingle(task); + runSingle(task, domain); } while(laterQueue.length){ @@ -116,8 +116,8 @@ var nextTick =(function () { } flushing = false; } - - function runSingle(task){ // runs a single function in the async queue + // runs a single function in the async queue + function runSingle(task, domain){ try { task();