This section says:
// WARNING! DO NOT USE! BAD UNSAFE HAZARD!functionmaybeSync(arg,cb){if(arg){cb();return;}fs.stat('file',cb);}This API is hazardous because in the following case:
maybeSync(true,()=>{foo();});bar();It is not clear whether foo() or bar() will be called first.
For me, if arg is true, the order is unambiguously maybeSync() -> cb() -> foo() -> bar(), i.e. no async at all. What do I miss?
This section says:
For me, if
argistrue, the order is unambiguouslymaybeSync() -> cb() -> foo() -> bar(), i.e. no async at all. What do I miss?