Skip to content

Improve valueDeclaration for js module merges#24707

Merged
sandersn merged 1 commit into
masterfrom
js/fix-valueDeclaration-for-module-merges
Jun 6, 2018
Merged

Improve valueDeclaration for js module merges#24707
sandersn merged 1 commit into
masterfrom
js/fix-valueDeclaration-for-module-merges

Conversation

@sandersn
Copy link
Copy Markdown
Member

@sandersn sandersn commented Jun 5, 2018

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:

// 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.

Fixes #24696

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.
@sandersn sandersn requested review from mhegazy and weswigham June 5, 2018 20:33
@sandersn
Copy link
Copy Markdown
Member Author

sandersn commented Jun 5, 2018

Note that this PR breaks chrome-devtools-frontend pretty severely since most of their classes hit #24703. I'll take a look at that next.

@sandersn sandersn merged commit 30994c8 into master Jun 6, 2018
@mhegazy mhegazy deleted the js/fix-valueDeclaration-for-module-merges branch June 6, 2018 19:29
@sandersn sandersn added the For Milestone Bug PRs that fix a bug with a specific milestone label Jan 31, 2020
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Author: Team For Milestone Bug PRs that fix a bug with a specific milestone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

In JS, global class with oorder merged static property assignment hides class members

3 participants