Skip to content

Fix #11592: Scala.js: Handle default params of native JS classes. #11857

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

sjrd
Copy link
Member

@sjrd sjrd commented Mar 23, 2021

They must not be emitted, just like regular methods inside native JS classes are not emitted.

This ensures that if the default value is = js.native, it is not emitted, and therefore does not report an error tha calling js.native is illegal in non-native code.


This is in fact a blocker to upgrade scalajs-dom to Scala 3, so I'm assigning it to 3.0.0-RC2. It should be straightforward.

They must not be emitted, just like regular methods inside native
JS classes are not emitted.

This ensures that if the default value is `= js.native`, it is not
emitted, and therefore does not report an error tha calling
`js.native` is illegal in non-native code.
@sjrd sjrd added this to the 3.0.0-RC2 milestone Mar 23, 2021
@sjrd sjrd requested a review from nicolasstucki March 23, 2021 09:54
@nicolasstucki nicolasstucki merged commit c0b3fde into scala:master Mar 23, 2021
@nicolasstucki nicolasstucki deleted the sjs-fix-default-params-in-js-native-class-ctor branch March 23, 2021 13:58
odersky pushed a commit to dotty-staging/dotty that referenced this pull request Mar 24, 2021
…ams-in-js-native-class-ctor

Fix scala#11592: Scala.js: Handle default params of native JS classes.
@Kordyjan Kordyjan modified the milestones: 3.0.0-RC2, 3.0.0 Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compiler rejects native default constructor parameters when compiling Scala.js native classes
3 participants