forked from scala-js/scala-js
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix scala-js#4929: Fix logic for moving early assignements in JS ctors.
Previously, the logic was based on moving statements after the constructor by default, but keep selected ones before. The list of what to keep turned out to be too restrictive, and it was not clear how to expand it in a principled way. Instead, we now reverse that logic. We keep statements where they are by default, and only move `C.this.field = ident;` statements after the super constructor call. This requires only a little bit of special-casing for outer pointer null checks. Fortunately, we already some logic to identify and decompose those, which we reuse here.
- Loading branch information
Showing
3 changed files
with
167 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters