sourceTextModule.hasAsyncGraph()
新增于: v24.9.0
遍历依赖图,如果依赖中的任何模块或本模块本身包含顶层 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.