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

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

Issue 301383002: DevTools: [JsDocValidator] Check that param lists are completely annotated (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address comments Created 6 years, 7 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
« no previous file with comments | « Source/devtools/scripts/jsdoc-validator/tests/golden.dat ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/scripts/jsdoc-validator/tests/return.js
diff --git a/Source/devtools/scripts/jsdoc-validator/tests/return.js b/Source/devtools/scripts/jsdoc-validator/tests/return.js
deleted file mode 100644
index 3f919301a62ab2845d046bafba06b5ead675cbe8..0000000000000000000000000000000000000000
--- a/Source/devtools/scripts/jsdoc-validator/tests/return.js
+++ /dev/null
@@ -1,293 +0,0 @@
-function badFuncNoAnnotation() {
- return 1; // ERROR - no @return annotation.
-}
-
-/**
- * @return {number}
- */
-function badFuncAnnotatedButNoReturn() // ERROR - no @return annotation.
-{
-}
-
-/**
- * @return {number}
- */
-function badFuncAnnotatedButNoReturnValue() // ERROR - no returned value.
-{
- return;
-}
-
-/**
- * @return {number}
- */
-function goodFunc() // OK - annotated @return.
-{
- return 1;
-}
-
-/**
- * @returns {number}
- */
-function badReturnsShouldBeReturnFunc() // ERROR - @returns, should be @return.
-{
- return 1;
-}
-
-/**
- * @returns {number}
- */
-function badReturnsShouldBeReturnNoValueFunc() // ERROR - @returns, should be @return.
-{
- return;
-}
-
-/**
- * @returns {number}
- */
-function badReturnsShouldBeAbsentFunc() // ERROR - @returns, should be absent.
-{
-}
-
-/**
- * @constructor
- */
-function TypeOne() {
- function callback() // OK - not a method.
- {
- return 1;
- }
-}
-
-TypeOne.prototype = {
- badApiMethodNoAnnotation: function() // ERROR - public method.
- {
- return 1;
- },
-
- _privateMethod: function() // OK - non-public method.
- {
- return 1;
- },
-
- methodTwo: function()
- {
- function callback() // OK - not a method.
- {
- return 1;
- }
- },
-
- /**
- * @return {number}
- */
- methodThatThrows: function() // OK - throws and should be overridden in subclasses.
- {
- throw "Not implemented";
- },
-
- /**
- * @return {number}
- */
- badMethodDoesNotReturnValue: function() // ERROR - does not return value.
- {
- return;
- },
-
- /**
- * @return {number}
- */
- badMethodDoesNotReturn: function() // ERROR - does not return.
- {
- var foo = 1;
- },
-
- /**
- * @returns {number}
- */
- badMethodReturnsShouldBeReturn: function() // ERROR - @returns, should be @return
- {
- return 1;
- },
-
- /**
- * @returns {number}
- */
- badMethodReturnsShouldBeAbsentToo: function() // ERROR - @returns, should be absent
- {
- return;
- },
-
- /**
- * @returns {number}
- */
- badMethodReturnsShouldBeAbsent: function() // ERROR - @returns, should be absent
- {
- var foo = 1;
- }
-}
-
-
-/**
- * @constructor
- */
-TypeTwo = function() {
- function callback() // OK - not a method.
- {
- return 1;
- }
-}
-
-TypeTwo.prototype = {
- badApiMethodNoAnnotation: function() // ERROR - public method.
- {
- return 1;
- },
-
- _privateMethod: function() // OK - non-public method.
- {
- return 1;
- },
-
- methodTwo: function()
- {
- function callback() // OK - not a method.
- {
- return 1;
- }
- },
-
- /**
- * @return {number}
- */
- badMethodDoesNotReturnValue: function() // ERROR - does not return value.
- {
- return;
- },
-
- /**
- * @return {number}
- */
- badMethodDoesNotReturn: function() // ERROR - does not return.
- {
- var foo = 1;
- },
-
- /**
- * @returns {number}
- */
- badMethodReturnsShouldBeReturn: function() // ERROR - @returns, should be @return
- {
- return 1;
- },
-
- /**
- * @returns {number}
- */
- badMethodReturnsShouldBeAbsentToo: function() // ERROR - @returns, should be absent
- {
- return;
- },
-
- /**
- * @returns {number}
- */
- badMethodReturnsShouldBeAbsent: function() // ERROR - @returns, should be absent
- {
- var foo = 1;
- }
-}
-
-/**
- * @interface
- */
-Interface = function() {}
-
-Interface.prototype = {
- /**
- * @return {number}
- */
- interfaceMethod: function() {}, // OK - interface method.
-
- /**
- * @returns {number}
- */
- badReturnsInterfaceMethod: function() {} // ERROR - @returns instead of return.
-}
-
-/**
- * @return {!Object}
- */
-function returnConstructedObject() {
-
-/**
- * @constructor
- */
-TypeThree = function() {
- function callback() // OK - not a method.
- {
- return 1;
- }
-}
-
-TypeThree.prototype = {
- badApiMethodNoAnnotation: function() // ERROR - public method.
- {
- return 1;
- },
-
- _privateMethod: function() // OK - non-public method.
- {
- return 1;
- },
-
- methodTwo: function()
- {
- function callback() // OK - not a method.
- {
- return 1;
- }
- },
-
- /**
- * @return {number}
- */
- badMethodDoesNotReturnValue: function() // ERROR - does not return value.
- {
- return;
- },
-
- /**
- * @return {number}
- */
- badMethodDoesNotReturn: function() // ERROR - does not return.
- {
- var foo = 1;
- },
-
- /**
- * @returns {number}
- */
- badMethodReturnsShouldBeReturn: function() // ERROR - @returns, should be @return
- {
- return 1;
- },
-
- /**
- * @returns {number}
- */
- badMethodReturnsShouldBeAbsentToo: function() // ERROR - @returns, should be absent
- {
- return;
- },
-
- /**
- * @returns {number}
- */
- badMethodReturnsShouldBeAbsent: function() // ERROR - @returns, should be absent
- {
- var foo = 1;
- }
-}
-
-return new TypeThree();
-}
« no previous file with comments | « Source/devtools/scripts/jsdoc-validator/tests/golden.dat ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698