阿西河

所有教程

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

我的收藏

    最近访问  (文章)

      教程列表

      抓包专区
      测试专区

      Node.js script.compileFunction

      Node.js script.compileFunction(code[, params[, options]])

      新增于: v10.10.0

      • code < string> The body of the function to compile.
      • params < string[]> An array of strings containing all parameters for the function.
      • options < Object>
        • filename < string> Specifies the filename used in stack traces produced by this script. Default: ‘’.
        • lineOffset < number> Specifies the line number offset that is displayed in stack traces produced by this script. Default: 0.
        • columnOffset < number> Specifies the column number offset that is displayed in stack traces produced by this script. Default: 0.
        • cachedData < Buffer> Provides an optional Buffer with V8’s code cache data for the supplied source.
        • produceCachedData < boolean> Specifies whether to produce new cache data. Default: false.
        • parsingContext < Object> The contextified sandbox in which the said function should be compiled in.
        • contextExtensions <Object[]> An array containing a collection of context extensions (objects wrapping the current scope) to be applied while compiling. Default: [].

      Compiles the given code into the provided context/sandbox (if no context is supplied, the current context is used), and returns it wrapped inside a function with the given params.


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


      目录
      本文目录
      目录