In a sense, it is disgusting that it is a function that calls itself, but I believe that you are correct in that the stack trace did not pass. On normal execution, the stack will simply show that it was called setTimeout. The Chrome debugger, for example, will allow you to save stack traces when running async, I'm not sure how they do it, but the engine can track it somehow.
Regardless of how the literal is computed, execution will still be asynchronous.
setTimeout(function(){console.log('timeout');}, 0);console.log('executing');
will output:
executing undefined timeout
pllee Nov 11 '14 at 23:27 2014-11-11 23:27
source share