promise

what happens when a Promise never resolves? [duplicate]

孤街浪徒 提交于 2020-11-24 10:41:11
问题 This question already has answers here : Node exits without error and doesn't await promise (Event callback) (2 answers) Closed 3 years ago . I have this very confusing snippet of code using es6 async await syntax. What I would expect to happen is that the process hangs on the await line forever, since the resolve function is never called. However, what actually happens is that "start" is outputted and then the process exits with no more output. const simple = async () => { console.log('start

what happens when a Promise never resolves? [duplicate]

一世执手 提交于 2020-11-24 10:36:24
问题 This question already has answers here : Node exits without error and doesn't await promise (Event callback) (2 answers) Closed 3 years ago . I have this very confusing snippet of code using es6 async await syntax. What I would expect to happen is that the process hangs on the await line forever, since the resolve function is never called. However, what actually happens is that "start" is outputted and then the process exits with no more output. const simple = async () => { console.log('start

what happens when a Promise never resolves? [duplicate]

半腔热情 提交于 2020-11-24 10:36:19
问题 This question already has answers here : Node exits without error and doesn't await promise (Event callback) (2 answers) Closed 3 years ago . I have this very confusing snippet of code using es6 async await syntax. What I would expect to happen is that the process hangs on the await line forever, since the resolve function is never called. However, what actually happens is that "start" is outputted and then the process exits with no more output. const simple = async () => { console.log('start

what happens when a Promise never resolves? [duplicate]

纵然是瞬间 提交于 2020-11-24 10:35:22
问题 This question already has answers here : Node exits without error and doesn't await promise (Event callback) (2 answers) Closed 3 years ago . I have this very confusing snippet of code using es6 async await syntax. What I would expect to happen is that the process hangs on the await line forever, since the resolve function is never called. However, what actually happens is that "start" is outputted and then the process exits with no more output. const simple = async () => { console.log('start