【问题标题】:How to read function description in code?如何阅读代码中的功能描述?
【发布时间】:2019-03-26 00:28:33
【问题描述】:

我有这个代码

/** This is test function
 * @param  {} param1 this is param 1
 * @param  {} param2 this is param 2
 */
function test(param1, param2) {

}

我正在寻找一种在 代码 中获取此 js 文档描述的方法。 比如

function getMethodJsDocData(){
  // The magic happens here and returns some data that contains:
  /** This is test function
   * @param  {} param1 this is param 1
   * @param  {} param2 this is param 2
   */
}

【问题讨论】:

    标签: javascript node.js reflection documentation jsdoc


    【解决方案1】:

    我不相信这是可能的。

    Closure Compiler 不是 JS 编译 JS,它是一个独立的 Java 程序编译 JS。

    JS 本身通常不知道/* comments*/

    【讨论】:

      猜你喜欢
      • 2013-09-19
      • 1970-01-01
      • 1970-01-01
      • 2011-07-25
      • 1970-01-01
      • 1970-01-01
      • 2015-09-29
      • 2012-06-01
      • 1970-01-01
      相关资源
      最近更新 更多