Is DOM rendering GUARANTEED to block during a single (synchronous) function's execution?

前端 未结 2 533
孤独总比滥情好
孤独总比滥情好 2020-12-10 07:01

DOM blocking is something many people not familiar with JavaScript\'s strictly single-threaded synchronous execution model find out about the hard way, and it\'s usually jus

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-10 07:13

    There is nothing in Javascript related to concurrency that is anything but de facto. JS simply does not define a concurrency model. Everything is happy accident or years of consensus.

    That said, if your function does not make any calls to weird things like XMLHttpRequest or "alert" or something like that, you can basically treat it as single-threaded with no interrupts.

提交回复
热议问题