1
Closure Compiler可以使用有关JavaScript变量的数据类型信息来提供增强的优化和警告。我将在哪里使用谷歌关闭功能注释?
我在看their type expressions并查看几个函数类型列表。例如:
{function(string, boolean)}
A function that takes two parameters (a string and a boolean), and has an unknown return value.
又如:
{function(new:goog.ui.Menu, string)}
A function that takes one parameter (a string), and creates a new instance of goog.ui.Menu when called with the 'new' keyword.
有人能告诉我在哪里,我会使用这些注解,并给它会是什么样子在实践中的例子吗?它们主要用于@param和@return函数作为参数或返回函数吗?
好的。我脑海中过度复杂。谢谢。 – 2011-12-18 00:39:46
感谢您的这一点,我认为这也是必要的或用于评论功能本身。 – 2012-04-30 11:23:25