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.
18 lines
346 B
TypeScript
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 = {};
|