From: Trevor Norris Date: Tue, 6 Aug 2013 21:22:13 +0000 (-0700) Subject: node: remove domain nextTick X-Git-Tag: v0.11.6~71 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2ef1782bbce15f81b4087d07abe33ef006e7c02d;p=platform%2Fupstream%2Fnodejs.git node: remove domain nextTick It's ridiculously cheap to check if process.domain is set. Don't bother cluttering the code. --- diff --git a/src/node.cc b/src/node.cc index a1e3fea..bb3ab87 100644 --- a/src/node.cc +++ b/src/node.cc @@ -910,20 +910,12 @@ void SetupDomainUse(const FunctionCallbackInfo& args) { Local process = PersistentToLocal(node_isolate, process_p); Local tdc_v = process->Get(FIXED_ONE_BYTE_STRING(node_isolate, "_tickDomainCallback")); - Local ndt_v = - process->Get(FIXED_ONE_BYTE_STRING(node_isolate, "_nextDomainTick")); if (!tdc_v->IsFunction()) { fprintf(stderr, "process._tickDomainCallback assigned to non-function\n"); abort(); } - if (!ndt_v->IsFunction()) { - fprintf(stderr, "process._nextDomainTick assigned to non-function\n"); - abort(); - } Local tdc = tdc_v.As(); - Local ndt = ndt_v.As(); process->Set(FIXED_ONE_BYTE_STRING(node_isolate, "_tickCallback"), tdc); - process->Set(FIXED_ONE_BYTE_STRING(node_isolate, "nextTick"), ndt); process_tickCallback.Reset(node_isolate, tdc); } diff --git a/src/node.js b/src/node.js index f5411cf..0652bdf 100644 --- a/src/node.js +++ b/src/node.js @@ -330,7 +330,6 @@ process.nextTick = nextTick; // needs to be accessible from cc land - process._nextDomainTick = _nextDomainTick; process._tickCallback = _tickCallback; process._tickDomainCallback = _tickDomainCallback; @@ -415,16 +414,10 @@ if (process._exiting) return; - nextTickQueue.push({ callback: callback, domain: null }); - infoBox[length]++; - } - - function _nextDomainTick(callback) { - // on the way out, don't bother. it won't get fired anyway. - if (process._exiting) - return; - - nextTickQueue.push({ callback: callback, domain: process.domain }); + nextTickQueue.push({ + callback: callback, + domain: process.domain || null + }); infoBox[length]++; } };