TypeScript/tests/cases/conformance/salsa/typeFromPrototypeAssignment.ts
Nathan Shively-Sanders 614423b287
Fix this-type in prototype-assigned object literals (#26925)
* Fix this-type in prototype-assigned object literals

Some cases were missing from tryGetThisTypeAt.
Fixes #26831

* Lookup this in JS only for  @constructor+prototype assignments
2018-09-12 16:21:17 -07:00

45 lines
644 B
TypeScript

// @noEmit: true
// @allowJs: true
// @checkJs: true
// @Filename: a.js
// @strict: true
// all references to _map, set, get, addon should be ok
/** @constructor */
var Multimap = function() {
this._map = {};
this._map
this.set
this.get
this.addon
};
Multimap.prototype = {
set: function() {
this._map
this.set
this.get
this.addon
},
get() {
this._map
this.set
this.get
this.addon
}
}
Multimap.prototype.addon = function () {
this._map
this.set
this.get
this.addon
}
var mm = new Multimap();
mm._map
mm.set
mm.get
mm.addon