module.status


模块的当前状态。可能为以下之一:

【The current status of the module. Will be one of:】

  • '未链接':尚未调用 module.link()
  • 'linking'module.link() 已被调用,但链接器函数返回的所有 Promise 尚未全部解决。
  • 'linked':模块已成功链接,且其所有依赖也已链接,但尚未调用 module.evaluate()
  • 'evaluating':该模块正在通过对自身或父模块调用 module.evaluate() 进行评估。
  • 'evaluated':模块已成功评估。
  • 'errored':该模块已被评估,但抛出了一个异常。

除了 'errored',这个状态字符串对应规范中 循环模块记录[[Status]] 字段。'errored' 对应规范中的 'evaluated',但 [[EvaluationError]] 被设置为一个不为 undefined 的值。

【Other than 'errored', this status string corresponds to the specification's Cyclic Module Record's [[Status]] field. 'errored' corresponds to 'evaluated' in the specification, but with [[EvaluationError]] set to a value that is not undefined.】