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

Created Unassigned: Intellisense, createServer and tracking inferred type across functions [1586]

$
0
0
Intellisense see the request object in the onRequest function as a ClientRequest object and not an IncomingMessage object:

```
var http = require("http");
var url = require("url");

function start(route, handle)
{
function onRequest(request, response)
{
var pathname = url.parse(request.url).pathname;
console.log("Request for " + pathname + " received.");

route(handle, pathname, response);
}

http.createServer(onRequest).listen(8888);
console.log("Server has started");

}

exports.start = start;
```

This means that request.url is of unknown type, same for pathname. I am not sure if this is the reason, but in the route function all the parameters are of unknown type after that and the inferred type tracking stop working at that point.


Viewing all articles
Browse latest Browse all 4630

Trending Articles



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