Skip to content

Conversation

@sjrd
Copy link
Member

@sjrd sjrd commented Apr 26, 2024

We are several versions behind. Here is a first step.

The commit messages mention the upstream commits that were forward ported.

Tests come for free in the "Upgrade to Scala.js 1.13.0." commit.

sjrd added 4 commits April 25, 2024 15:45
Instead of having separate checks for members and classes/modules, we unify them. This gives simpler code and will make it easier to allow nested objects. Additionally: We report a proper error when attempting to export a JS native member (instead of crashing the compiler). Forward port of the upstream commit scala-js/scala-js@14de17d
The `New` is not enough for an `object class Foo$` that is an inner JS object. It needs the correct wrapping generated by `ExplicitJSClasses`. That wrapping exists in the `lazy def` defined in the trait, but cannot be reproduced in the implementing class. In general, we need full paths to do that, which are long gone. When extending a Scala 3-defined trait, we can actually generate a call to the `lazy def`. Although it was never called before (and still is never called for non-JS objects), it was always generated by the Scala 3 compilers. Scala 2, however, does not emit those `lazy def`s. Since I don't see a way out (yet), we report an "Implementation restriction" error in that case.
Code changes are forward ports of the following refactorings: * Split members of ClassDef by type scala-js/scala-js@ec3f406 * Unify TreeHash and Versioned into a single Version scala-js/scala-js@9f5071f * Fix scala-js/scala-js#4769: Give JSPropertyDef a hash scala-js/scala-js@c2bf430
@sjrd sjrd requested a review from bishabosha April 26, 2024 13:55
@sjrd sjrd enabled auto-merge April 26, 2024 14:30
@sjrd sjrd merged commit 5e533a8 into scala:main Apr 26, 2024
@sjrd sjrd deleted the scalajs-1.13.0 branch April 26, 2024 15:59
@Kordyjan Kordyjan added this to the 3.5.0 milestone May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants