TypeScript/tests/cases/conformance/salsa/chainedPrototypeAssignment.ts
Nathan Shively-Sanders 3c42760765
Cache JS inferred class type symbol (#33010)
* Cache JS inferred class type symbol

Note that many sources merge into a single target, so the *source*
[links] is the one that caches the merged target.

The reason this is a problem is not that many sources merge into a
single target, but that both getTypeOfSymbol and getDeclaredTypeOfSymbol
end up calling mergeJSSymbols with the same [source,target] pair. The
merge should not happen twice.

* Remove more verbose debug assertion message

* Fix isJSConstructor check + update baselines

* inferClassSymbol cache now track multiple targets
2019-08-21 15:36:35 -07:00

32 lines
595 B
TypeScript

// @noEmit: true
// @allowJs: true
// @checkJs: true
// @noImplicitAny: true
// @Filename: types.d.ts
declare function require(name: string): any;
declare var exports: any;
// @Filename: mod.js
/// <reference path='./types.d.ts'/>
var A = function A() {
this.a = 1
}
var B = function B() {
this.b = 2
}
exports.A = A
exports.B = B
A.prototype = B.prototype = {
/** @param {number} n */
m(n) {
return n + 1
}
}
// @Filename: use.js
/// <reference path='./types.d.ts'/>
var mod = require('./mod');
var a = new mod.A()
var b = new mod.B()
a.m('nope')
b.m('not really')