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

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

Issue 319733002: DevTools: [JsDocValidator] Be smarter about function name and JSDoc detection (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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 function badFuncNoAnnotation() { 1 function badFuncNoAnnotation() {
2 return 1; // ERROR - no @return annotation. 2 return 1; // ERROR - no @return annotation.
3 } 3 }
4 4
5 /** 5 /**
6 * @return {number} 6 * @return {number}
7 */ 7 */
8 function badFuncAnnotatedButNoReturn() // ERROR - no @return annotation. 8 function badFuncAnnotatedButNoReturn() // ERROR - no @return annotation.
9 { 9 {
10 } 10 }
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 } 77 }
78 78
79 TypeOne.prototype = { 79 TypeOne.prototype = {
80 badApiMethodNoAnnotation: function() // ERROR - public method. 80 badApiMethodNoAnnotation: function() // ERROR - public method.
81 { 81 {
82 return 1; 82 return 1;
83 }, 83 },
84 84
85 _privateMethod: function() // OK - non-public method. 85 _privateMethod: function() // OK - non-public method.
86 { 86 {
87 var obj = {};
88
89 /**
90 * @param {number} val
91 */
92 obj["a"] = obj["b"] = function(val) { // ERROR - no @this
93 this.foo = val;
94 }
95
87 return 1; 96 return 1;
88 }, 97 },
89 98
90 methodTwo: function() 99 methodTwo: function()
91 { 100 {
92 function callback() // OK - not a method. 101 function callback() // OK - not a method.
93 { 102 {
94 return 1; 103 return 1;
95 } 104 }
96 }, 105 },
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 * @param {string} a 350 * @param {string} a
342 * @param {string} c 351 * @param {string} c
343 */ 352 */
344 function funcParamsMissingTag1(a, b, c) {} 353 function funcParamsMissingTag1(a, b, c) {}
345 354
346 /** 355 /**
347 * @param {string} a 356 * @param {string} a
348 */ 357 */
349 function funcParamsMissingTag2(a, b, c) {} 358 function funcParamsMissingTag2(a, b, c) {}
350 359
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698