org.scalajs.core

compiler

package compiler

Visibility
  1. Public
  2. All

Type Members

  1. trait Compat210Component extends AnyRef

    Hacks to have our source code compatible with 2.10 and 2.11.

    Hacks to have our source code compatible with 2.10 and 2.11. It exposes 2.11 API in a 2.10 compiler.

  2. abstract class GenJSCode[G <: Global with Singleton] extends PluginComponent with TypeKinds[G] with JSEncoding[G] with GenJSExports[G] with GenJSFiles[G] with PluginComponent210Compat

    Generate JavaScript code and output it to disk

  3. trait GenJSExports[G <: Global with Singleton] extends SubComponent

    Generation of exports for JavaScript

  4. trait GenJSFiles[G <: Global with Singleton] extends SubComponent

    Send JS ASTs to files

  5. trait JSDefinitions extends AnyRef

    Core definitions for Scala.js

  6. trait JSEncoding[G <: Global with Singleton] extends SubComponent

    Encoding of symbol names for JavaScript

    Encoding of symbol names for JavaScript

    Some issues that this encoding solves: * Overloading: encode the full signature in the JS name * Same scope for fields and methods of a class * Global access to classes and modules (by their full name)

  7. trait JSGlobalAddons extends JSDefinitions with Compat210Component

    Additions to Global meaningful for the JavaScript backend

  8. abstract class JSPrimitives extends AnyRef

    Extension of ScalaPrimitives for primitives only relevant to the JS backend

  9. trait PluginComponent210Compat extends Compat210Component

  10. abstract class PreTyperComponent extends PluginComponent with Transform with PluginComponent210Compat

    This jspretyper phase prepares a fix for issue SI-9487 in the case of anonymous classes that extend js.Any.

    This jspretyper phase prepares a fix for issue SI-9487 in the case of anonymous classes that extend js.Any.

    During typer, due to a bug (SI-9487), Scalac transfroms some public method definitions of a quite specific syntactic form of anonymous classes into private methods. This affects both methods and field accessors. This phase identifies any anonymous class and adds a @WasPublicBeforeTyper annotation on its public methods and fields. After the typer in jsinterop the anonymous classes are fixed if they extend js.Any using the annotations as reference.

    As an example:

    class $anon extends ... {
      val foo = ???
      var bar = ???
      def baz = ???
      private val foo2 = ???
      private var bar2 = ???
      private def baz2 = ???
    }

    Would become:

    class $anon extends ... {
      @WasPublicBeforeTyper val foo = ???
      @WasPublicBeforeTyper var bar = ???
      @WasPublicBeforeTyper def baz = ???
      private val foo2 = ???
      private var bar2 = ???
      private def baz2 = ???
    }

    And after typer (if has SI-9487) will be:

    class $anon extends ... {
      @WasPublicBeforeTyper private[this] var foo = ???
      private <stable> <accessor> def foo = ??? // Needs fix
    
      @WasPublicBeforeTyper private[this] var bar = ???
      private <accessor> def bar = ??? // Needs fix
      private <accessor> def bar_=(...) = ??? // Needs fix
    
      @WasPublicBeforeTyper private def baz = ??? // Needs fix
      ...
    }
  11. trait PrepJSExports[G <: Global with Singleton] extends AnyRef

    Prepare export generation

    Prepare export generation

    Helpers for transformation of @JSExport annotations

  12. abstract class PrepJSInterop[G <: Global with Singleton] extends PluginComponent with PrepJSExports[G] with Transform with PluginComponent210Compat

    Prepares classes extending js.Any for JavaScript interop

    Prepares classes extending js.Any for JavaScript interop

    This phase does: - Sanity checks for js.Any hierarchy - Annotate subclasses of js.Any to be treated specially - Rewrite calls to scala.Enumeration.Value (include name string) - Create JSExport methods: Dummy methods that are propagated through the whole compiler chain to mark exports. This allows exports to have the same semantics than methods.

  13. trait ScalaJSOptions extends AnyRef

    This trait allows to query all options to the ScalaJS plugin

    This trait allows to query all options to the ScalaJS plugin

    Also see the help text in ScalaJSPlugin for information about particular options.

  14. class ScalaJSPlugin extends Plugin with Compat210Component

    Main entry point for the Scala.js compiler plugin

  15. trait TypeKinds[G <: Global with Singleton] extends SubComponent

    Glue representation of types as seen from the IR but still with a reference to the Symbols.

Value Members

  1. object Compat210Component

  2. object JSTreeExtractors

    Useful extractors for JavaScript trees

  3. object PrepJSInterop

  4. object ScalaJSOptions

  5. package util

Ungrouped