Hacks to have our source code compatible with 2.10 and 2.11.
Generate JavaScript code and output it to disk
Generation of exports for JavaScript
Send JS ASTs to files
Core definitions for Scala.js
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)
Additions to Global meaningful for the JavaScript backend
Extension of ScalaPrimitives for primitives only relevant to the JS backend
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 ... }
Prepare export generation
Prepare export generation
Helpers for transformation of @JSExport annotations
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.
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.
Main entry point for the Scala.js compiler plugin
Glue representation of types as seen from the IR but still with a reference to the Symbols.
Useful extractors for JavaScript trees
Hacks to have our source code compatible with 2.10 and 2.11. It exposes 2.11 API in a 2.10 compiler.