From 457603e96194b4858ad715f9faacb3ad7fec7f35 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Wed, 19 Dec 2018 18:44:14 +0800 Subject: src: move process.nextTick and promise setup into node_task_queue.cc This patch: - Moves the process.nextTick and promise setup C++ code into node_task_queue.cc which is exposed as `internalBinding('task_queue')` - Makes `lib/internal/process/promises.js` and `lib/internal/process/next_tick.js` as side-effect-free as possible - Removes the bootstrapper object being passed into `bootstrap/node.js`, let `next_tick.js` and `promises.js` load whatever they need from `internalBinding('task_queue')` instead. - Rename `process._tickCallback` to `runNextTicks` internally for clarity but still expose it as `process._tickCallback`. PR-URL: https://github.com/nodejs/node/pull/25163 Refs: https://github.com/nodejs/node/issues/24961 Reviewed-By: Ruben Bridgewater Reviewed-By: Anatoli Papirovski --- test/message/events_unhandled_error_nexttick.out | 2 +- test/message/nexttick_throw.out | 2 +- test/message/unhandled_promise_trace_warnings.out | 2 +- test/parallel/test-bootstrap-modules.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/message/events_unhandled_error_nexttick.out b/test/message/events_unhandled_error_nexttick.out index 1c0ed6df93..aa52367ba0 100644 --- a/test/message/events_unhandled_error_nexttick.out +++ b/test/message/events_unhandled_error_nexttick.out @@ -16,7 +16,7 @@ Error Emitted 'error' event at: at process.nextTick (*events_unhandled_error_nexttick.js:*:*) at internalTickCallback (internal/process/next_tick.js:*:*) - at process._tickCallback (internal/process/next_tick.js:*:*) + at process.runNextTicks [as _tickCallback] (internal/process/next_tick.js:*:*) at Function.Module.runMain (internal/modules/cjs/loader.js:*:*) at executeUserCode (internal/bootstrap/node.js:*:*) at startExecution (internal/bootstrap/node.js:*:*) diff --git a/test/message/nexttick_throw.out b/test/message/nexttick_throw.out index 2bf69e8146..1fee9075fe 100644 --- a/test/message/nexttick_throw.out +++ b/test/message/nexttick_throw.out @@ -5,7 +5,7 @@ ReferenceError: undefined_reference_error_maker is not defined at *test*message*nexttick_throw.js:*:* at internalTickCallback (internal/process/next_tick.js:*:*) - at process._tickCallback (internal/process/next_tick.js:*:*) + at process.runNextTicks [as _tickCallback] (internal/process/next_tick.js:*:*) at Function.Module.runMain (internal/modules/cjs/loader.js:*:*) at executeUserCode (internal/bootstrap/node.js:*:*) at startExecution (internal/bootstrap/node.js:*:*) diff --git a/test/message/unhandled_promise_trace_warnings.out b/test/message/unhandled_promise_trace_warnings.out index 2187ee1e85..0b2ef99941 100644 --- a/test/message/unhandled_promise_trace_warnings.out +++ b/test/message/unhandled_promise_trace_warnings.out @@ -42,7 +42,7 @@ at * (node:*) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 1) at handledRejection (internal/process/promises.js:*) - at handler (internal/process/promises.js:*) + at promiseRejectHandler (internal/process/promises.js:*) at Promise.then * at Promise.catch * at Immediate.setImmediate (*test*message*unhandled_promise_trace_warnings.js:*) diff --git a/test/parallel/test-bootstrap-modules.js b/test/parallel/test-bootstrap-modules.js index 3f67144f5f..ee4864e09b 100644 --- a/test/parallel/test-bootstrap-modules.js +++ b/test/parallel/test-bootstrap-modules.js @@ -9,7 +9,7 @@ const common = require('../common'); const assert = require('assert'); const isMainThread = common.isMainThread; -const kMaxModuleCount = isMainThread ? 61 : 83; +const kMaxModuleCount = isMainThread ? 62 : 84; assert(list.length <= kMaxModuleCount, `Total length: ${list.length}\n` + list.join('\n') -- cgit v1.2.3