簡體   English   中英

什么是“ Google JavaScript樣式指南”中所述的JavaScript源文件

[英]What are JavaScript source files as described in 'Google JavaScript Style Guide'

我仍然是新手。 我正在閱讀“ Google JS樣式指南”。 我想知道- 第3節“源文件結構”指的是什么? 它始於:

源文件按以下順序組成:

  1. 許可或版權信息(如果有)
  2. @fileoverview JSDoc(如果存在)
  3. goog.module語句
  4. goog.require語句
  5. 文件的實現
/**
     * @fileoverview Description of file, its uses and information
     * about its dependencies.
     * @package
     */

    goog.module('my.test.helpers');
    goog.module.declareLegacyNamespace();
    goog.setTestOnly();

    const MyClass = goog.require('some.package.MyClass');
    const NsMyClass = goog.require('other.ns.MyClass');

它基本上表示上述格式。 我認為這個例子使用谷歌關閉庫。

https://github.com/google/closure-library

它們是文件,包含JavaScript源代碼。

即任何.js文件。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM