sourceTextModule.hasAsyncGraph()


遍历依赖图,如果其依赖中的任何模块或该模块本身包含顶层 await 表达式,则返回 true,否则返回 false

🌐 Iterates over the dependency graph and returns true if any module in its dependencies or this module itself contains top-level await expressions, otherwise returns false.

如果图足够大,搜索速度可能会很慢。

🌐 The search may be slow if the graph is big enough.

这要求先实例化该模块。如果模块尚未实例化,将会抛出错误。

🌐 This requires the module to be instantiated first. If the module is not instantiated yet, an error will be thrown.