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

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

Issue 199733011: DevTools: [JsDocValidator] Avoid false-positive function receiver-related errors (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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
« no previous file with comments | « Source/devtools/scripts/jsdoc-validator/tests/golden.dat ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 this.foo = this.foo + 1; // OK - outside of function. 1 this.foo = this.foo + 1; // OK - outside of function.
2 2
3 function f() { 3 function f() {
4 this.foo = this.foo + 1; // OK - global |this|. 4 this.foo = this.foo + 1; // OK - global |this|.
5 } 5 }
6 6
7 /** 7 /**
8 * @constructor 8 * @constructor
9 */ 9 */
10 function TypeOne() { 10 function TypeOne() {
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 257
258 /** 258 /**
259 * @suppressReceiverCheck 259 * @suppressReceiverCheck
260 * @this {Object} 260 * @this {Object}
261 */ 261 */
262 function ignoredCallbackWithThis() 262 function ignoredCallbackWithThis()
263 { 263 {
264 this.foo = 1; 264 this.foo = 1;
265 } 265 }
266 object.callFunction(func, [], ignoredCallbackWithThis); // OK - ignored. 266 object.callFunction(func, [], ignoredCallbackWithThis); // OK - ignored.
267
268 function callbackReferencingThisNotAnnotated()
269 {
270 this.foo = 2;
271 }
272 this.memberTwo(callbackReferencingThisNotAnnotated.bind(this)); // OK - No @this annotation, but references |this|.
273
274 /**
275 * @this {Object}
276 */
277 function callbackNotReferencingThisAnnotated()
278 {
279 }
280 this.memberTwo(callbackNotReferencingThisAnnotated); // OK - Has @this a nnotation, but does not reference |this|.
267 }, 281 },
268 282
269 memberTwo: function(arg) {} 283 memberTwo: function(arg) {}
270 } 284 }
OLDNEW
« 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