Chromium Code Reviews| Index: third_party/WebKit/Source/devtools/scripts/jsdoc-validator/tests/this.js |
| diff --git a/third_party/WebKit/Source/devtools/scripts/jsdoc-validator/tests/this.js b/third_party/WebKit/Source/devtools/scripts/jsdoc-validator/tests/this.js |
| index b769a2858c3a8f6eb438ef75fc07f9b5ab85afec..1d3093b453ddbb6cfe06b186d138eed468d65cf7 100644 |
| --- a/third_party/WebKit/Source/devtools/scripts/jsdoc-validator/tests/this.js |
| +++ b/third_party/WebKit/Source/devtools/scripts/jsdoc-validator/tests/this.js |
| @@ -282,3 +282,37 @@ ReceiverTest.prototype = { |
| memberTwo: function(arg) {} |
| } |
| + |
| +/** |
| + * @constructor |
| + */ |
| +function ReceiverWithArrowsTest() |
| +{ |
| + this._q = []; |
| +} |
| + |
| +ReceiverWithArrowsTest.prototype = { |
| + /** |
| + * @param {string} s |
| + */ |
| + memberOne: function(s) |
| + { |
| + /** |
| + * @param {string} a |
| + * @this {!C} |
|
dgozman
2016/10/25 18:08:27
@this annotations don't need "!"
|
| + */ |
| + function testArrowFunctionReferencingThis(a) |
| + { |
| + (x => this._q.push(x))(a); |
| + } |
| + |
| + /** |
| + * @param {string} a |
| + * @this {!C} |
| + */ |
| + function testNestedArrowFunctionReferencingThis(a) |
| + { |
| + (x => (y => this._q.push(y))(x))(a); |
| + } |
| + } |
| +}; |