暂停脚本执行后,如何在chrome devtools中运行异步代码? [英] How to run asynchronous code in chrome devtools when script execution is paused?

查看:45
本文介绍了暂停脚本执行后,如何在chrome devtools中运行异步代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

await Promise.resolve(1)解析为:

    不暂停脚本执行时
  • 1
  • 在脚本执行暂停时承诺< pending>
  • 1 when script execution is not paused
  • Promise <pending> when script execution is paused

如何在脚本执行暂停时将其解析为 1

How to resolve it to 1 when script execution is paused

N.B.

此问题继续 Chrome调试器承诺暂停时不会解决?找到暂停Chrome时解决承诺的确切方法

this question continues chrome debugger promises dont resolve while paused? to find the exact way to resolve promises when chrome is paused

推荐答案

答案-当chrome中的js暂停时,即使在控制台中创建的诺言,也无法做出诺言来解决

Answer - it's not possible to make promises resolve WHEN js is paused in chrome, even promises that are created in console

(js是单线程的)

这篇关于暂停脚本执行后,如何在chrome devtools中运行异步代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆