TypeScript/tests/cases/fourslash/javaScriptPrototype3.ts
Nathan Shively-Sanders d3e0929b14
Mark js-assignment functions' symbols as methods (#23078)
This make display more accurate:
1. The functions now print as methods
2. When the type of the function references the class, the type of the
function itself is now printed correctly instead of as `any`.
2018-04-02 12:17:35 -07:00

20 lines
643 B
TypeScript

///<reference path="fourslash.ts" />
// Inside an inferred method body, the type of 'this' is the class type
// @allowNonTsExtensions: true
// @Filename: myMod.js
//// function myCtor(x) {
//// this.qua = 10;
//// }
//// myCtor.prototype.foo = function() { return this/**/; };
//// myCtor.prototype.bar = function() { return '' };
////
goTo.marker();
edit.insert('.');
// Check members of the function
verify.completionListContains('foo', undefined, undefined, 'method');
verify.completionListContains('bar', undefined, undefined, 'method');
verify.completionListContains('qua', undefined, undefined, 'property');