TypeScript/tests/cases/conformance/salsa/typeFromPropertyAssignmentOutOfOrder.ts
Nathan Shively-Sanders 30994c86e4
Improve valueDeclaration for js module merges (#24707)
Nearly everything in a merge of JS special assignments looks like a
valueDeclaration. This commit ensures that intermediate "module
declarations" are not used when a better valueDeclaration is available:

```js
// File1.js
var X = {}
X.Y.Z = class { }

// File2.js
X.Y = {}
```

In the above example, the `Y` in `X.Y.Z = class { }` was used as the
valueDeclaration for `Y` because it appeared before `X.Y = {}` in the
compilation.

This change exposed a bug in binding, #24703, that required a change in
typeFromPropertyAssignmentOutOfOrder. The test still fails for the
original reason it was created, and the new bug #24703 contains a repro.
2018-06-06 11:11:15 -07:00

18 lines
346 B
TypeScript

// @noEmit: true
// @allowJs: true
// @checkJs: true
// @target: es3
// @filename: index.js
First.Item = class I {}
Common.Object = class extends First.Item {}
Workspace.Object = class extends Common.Object {}
/** @type {Workspace.Object} */
var am;
// @filename: roots.js
var First = {};
var Common = {};
var Workspace = {};