阿西河

所有教程

公众号
🌙
阿西河前端的公众号

我的收藏

    最近访问  (文章)

      教程列表

      抓包专区
      测试专区

      Node.js module.evaluate

      Node.js module.evaluate([options])

      • options < Object>
        • timeout < integer> Specifies the number of milliseconds to evaluate before terminating execution. If execution is interrupted, an Error will be thrown. This value must be a strictly positive integer.
        • breakOnSigint < boolean> If true, the execution will be terminated when SIGINT (Ctrl+C) is received. Existing handlers for the event that have been attached via process.on(‘SIGINT’) will be disabled during script execution, but will continue to work after that. If execution is interrupted, an Error will be thrown.
      • Returns:

      Evaluate the module.

      This must be called after the module has been instantiated; otherwise it will throw an error. It could be called also when the module has already been evaluated, in which case it will do one of the following two things:

      • return undefined if the initial evaluation ended in success (module.status is ‘evaluated’)
      • rethrow the same exception the initial evaluation threw if the initial evaluation ended in an error (module.status is ‘errored’)

      This method cannot be called while the module is being evaluated (module.status is ‘evaluating’) to prevent infinite recursion.

      Corresponds to the Evaluate() concrete method field of Source Text Module Records in the ECMAScript specification.


      更多内容请参考:Node.js vm,或者通过 点击对应菜单 进行查看;


      目录
      本文目录
      目录