]> khamidou — GitHub mirrors - electron.git/commitdiff
Run microtask before handling pending process.nextTick tasks
authorCheng Zhao <zcbenz@gmail.com>
Fri, 7 Aug 2015 13:26:24 +0000 (21:26 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Fri, 7 Aug 2015 13:26:24 +0000 (21:26 +0800)
This follows the behavior of Node.js.

atom/common/api/atom_bindings.cc

index fa4a88d58437d561106858cffc71cb3cff539502..c748647f48d05beb8681195e14b31cfd3bd5e515 100644 (file)
@@ -98,6 +98,10 @@ void AtomBindings::OnCallNextTick(uv_async_t* handle) {
     if (tick_info->in_tick())
       continue;
 
+    if (tick_info->length() == 0) {
+      env->isolate()->RunMicrotasks();
+    }
+
     if (tick_info->length() == 0) {
       tick_info->set_index(0);
       continue;