Quantcast
Channel: Node.js Tools for Visual Studio
Viewing all articles
Browse latest Browse all 4630

Created Issue: Anonymous functions should acquire a name in a proper context [1088]

$
0
0
Consider:
```
function Foo() {
this.f = function () { }
}

var foo = new Foo();
foo.f(
```
The completion tip that shows at the last `(` says `<anonymous function>()`. While it technically is an anon function, this is not particularly helpful in this case, and confusing to the caller (esp. when called across package boundaries). We should try to give it a name in obvious cases like the above - at the very least when it's directly assigned to a field or variable.

This has implications for Express which uses this pattern heavily. Most of its functions and methods similarly show up as anonymous in completions.

Viewing all articles
Browse latest Browse all 4630

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>