admin管理员组文章数量:1417674
await Promise.resolve(1)
in chrome devtools (chrome version 70.0.3538.77) resolves to:
1
when script execution is not pausedPromise <pending>
when script execution is paused
How to resolve it to 1
when script execution is paused
N.B.
this question continues chrome debugger promises dont resolve while paused? to find the exact way to resolve promises when chrome is paused
await Promise.resolve(1)
in chrome devtools (chrome version 70.0.3538.77) resolves to:
1
when script execution is not pausedPromise <pending>
when script execution is paused
How to resolve it to 1
when script execution is paused
N.B.
this question continues chrome debugger promises dont resolve while paused? to find the exact way to resolve promises when chrome is paused
Share Improve this question edited Dec 19, 2018 at 14:16 srghma asked Dec 19, 2018 at 14:05 srghmasrghma 5,3932 gold badges41 silver badges62 bronze badges 13-
2
console.log(await Promise.resolve(1))
– Keith Commented Dec 19, 2018 at 14:18 -
1
@Keith, no, it resolves to
Promise <pending>
too – srghma Commented Dec 19, 2018 at 14:21 - @Keith, here is the reproduction imgur./a/oDDDet9 – srghma Commented Dec 19, 2018 at 14:23
- 1 @DanielBeck I dont want to execute the script, I want to execute async functions while script is paused (think about it, I can calculate ordinary functions while paused, but not async calls, why?) – srghma Commented Dec 19, 2018 at 14:29
- 2 Yes,. JS is single threaded, this means it has 1 single message loop. When you pause, it will pause the message loop. If it didn't it would make debugging even harder. What problem are you trying to solve, I wonder if this is an X/Y problem. – Keith Commented Dec 19, 2018 at 14:45
1 Answer
Reset to default 2Answer - it's not possible to make promises resolve WHEN js is paused in chrome, even promises that are created in console
(js is single threaded)
版权声明:本文标题:javascript - How to run asynchronous code in chrome devtools when script execution is paused? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745277066a2651248.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论