Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(914)

Unified Diff: Source/devtools/scripts/jsdoc-validator/tests/function.js

Issue 315213003: DevTools: [JsDocValidator] Check validity of @param and @return annotations (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/devtools/scripts/jsdoc-validator/tests/function.js
diff --git a/Source/devtools/scripts/jsdoc-validator/tests/function.js b/Source/devtools/scripts/jsdoc-validator/tests/function.js
index 42d8cddadc5d505ab2fb1c7013db12ae6813a995..4995c937b70f0b331efd138dff3f8120d7d89dce 100644
--- a/Source/devtools/scripts/jsdoc-validator/tests/function.js
+++ b/Source/devtools/scripts/jsdoc-validator/tests/function.js
@@ -34,6 +34,24 @@ function badReturnsShouldBeReturnFunc() // ERROR - @returns, should be @return.
}
/**
+ * @return number
+ */
+function badReturnShouldBeTypedFunc() // ERROR - number, not {number}.
+{
+ return 1;
+}
+
+/**
+ * @param number foo
+ * @param bar
+ */
+function badParamAnnotationsFunc(foo, bar) // ERROR - @param's should be well-formed
+{
+ return 1;
+}
+
+
+/**
* @returns {number}
*/
function badReturnsShouldBeReturnNoValueFunc() // ERROR - @returns, should be @return.
@@ -273,6 +291,14 @@ TypeThree.prototype = {
},
/**
+ * @returns number
+ */
+ badMethodReturnShouldBeTyped: function() // ERROR - number, not {number}
+ {
+ return 1;
+ },
+
+ /**
* @returns {number}
*/
badMethodReturnsShouldBeAbsentToo: function() // ERROR - @returns, should be absent
@@ -286,6 +312,15 @@ TypeThree.prototype = {
badMethodReturnsShouldBeAbsent: function() // ERROR - @returns, should be absent
{
var foo = 1;
+ },
+
+ /**
+ * @param number foo
+ * @param bar
+ */
+ badMethodParamAnnotations: function(foo, bar) // ERROR - @param's should be well-formed
+ {
+ return 1;
}
}

Powered by Google App Engine
This is Rietveld 408576698