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)
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745277066a4620103.html
评论列表(0条)