Skip to content
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

Scala.js: Various JS interop fixes #9763

Closed
wants to merge 13 commits into from
Closed

Commits on Sep 7, 2020

  1. Do not copy annotations from a class to its synthetic companion object.

    Normally, annotations applied to a class have no business being
    replicated on a synthetic companion object. One exception was the
    `@alpha` method, which is supposed to apply as well. Instead of
    trying to identify those annotations without the symbols during
    `Desugar`, we change `erasedName` to go look on the companion class
    of synthetic module classes.
    sjrd committed Sep 7, 2020
    Configuration menu
    Copy the full SHA
    b0f2868 View commit details
    Browse the repository at this point in the history

Commits on Sep 8, 2020

  1. Scala.js: Implement the PrepJSInterop phase, minus exports handling.

    The `PrepJSInterop` phase is responsible for:
    
    * Performing all kinds of Scala.js-specific compile-time checks,
      and emitting the appropriate compile errors.
    * Perform some transformations that are necessary for JavaScript
      interop, notably generating exports forwarders.
    
    This commit ports all the functionality of `PrepJSInterop` from
    Scala 2, except the following:
    
    * Handling of `scala.Enumeration`s: it is unclear whether we still
      want to support that in the core, or if it should be handled by
      an optional compiler plugin in the future.
    * Exports: they will be done later.
    * Warnings about duplicate fields in `js.Dynamic.literal`: mostly
      because they are non-essential.
    
    The test cases are ported from the Scala.js compiler tests.
    sjrd committed Sep 8, 2020
    Configuration menu
    Copy the full SHA
    9048512 View commit details
    Browse the repository at this point in the history

Commits on Sep 9, 2020

  1. Do not emit static forwarders for non-top-level objects by default.

    This is a forward port of the upstream commit
    scala-js/scala-js@3c3b100
    
    We now require the option
    `-scalajs-genStaticForwardersForNonTopLevelObjects` to emit static
    forwarders for non-top-level objects.
    
    In addition, we take `-XnoForwarders` into account, which we were
    erroneously not doing before.
    sjrd committed Sep 9, 2020
    Configuration menu
    Copy the full SHA
    8d4babb View commit details
    Browse the repository at this point in the history
  2. Do not erase a regular class with a static forwarder class.

    This is a forward port of the upstream commit
    scala-js/scala-js@6c82635
    
    Since dotc does not support warning suppression yet, we use a
    regular warning to report when we avoid emitting static forwarders.
    sjrd committed Sep 9, 2020
    Configuration menu
    Copy the full SHA
    221c25c View commit details
    Browse the repository at this point in the history
  3. Upgrade to Scala.js 1.2.0.

    And enable a number of tests that have been updated upstream to be
    compatible with dotty.
    sjrd committed Sep 9, 2020
    Configuration menu
    Copy the full SHA
    1ed50db View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    21ed7fa View commit details
    Browse the repository at this point in the history

Commits on Sep 10, 2020

  1. Configuration menu
    Copy the full SHA
    d251af2 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d10ccc9 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d3243ab View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    f8045e7 View commit details
    Browse the repository at this point in the history
  5. Scala.js: Implement @js.native vals and defs in the back-end.

    This is a forward port of the back-end changes in the upstream
    commit
    scala-js/scala-js@a1a27f2
    sjrd committed Sep 10, 2020
    Configuration menu
    Copy the full SHA
    5bd6b2d View commit details
    Browse the repository at this point in the history
  6. Scala.js: Consider that global scope objects are always NoInits.

    This is very important, as it prevents `SelectStatic` from creating
    dangling references to global scope objects. Such dangling
    references are invalid and trigger an error in the back-end.
    sjrd committed Sep 10, 2020
    Configuration menu
    Copy the full SHA
    62bd038 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    4b47833 View commit details
    Browse the repository at this point in the history