Home wrapping process.nextTick leads to Maximum call stack size exceeded
Reply: 0

wrapping process.nextTick leads to Maximum call stack size exceeded

user534
1#
user534 Published in July 18, 2018, 4:56 am

I am trying to wrap process.nextTick function but that leads to recursion.

var actual = process.nextTick;

process.nextTick = function(callback)
{
console.log('next tick called');
actual.apply(this, arguments);
}

console.log('starts');
setTimeout(function(){
console.log('set timeout called');
}, 100);

this code produces

starts
next tick called
next tick called
...
RangeError: Maximum call stack size exceeded

can anyone explain the workflow???

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.305925 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO