dotty.tools.backend.sjs

Members list

Type members

Classlikes

class GenSJSIR extends Phase

Generates Scala.js IR files for the compilation unit.

Generates Scala.js IR files for the compilation unit.

Attributes

Companion
object
Supertypes
class Phase
class Object
trait Matchable
class Any
object GenSJSIR

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
GenSJSIR.type
class JSCodeGen()(using genCtx: Context)

Main codegen for Scala.js IR.

Main codegen for Scala.js IR.

GenSJSIR creates one instance of JSCodeGen per compilation unit. The run() method processes the whole compilation unit and generates .sjsir files for it.

There are 4 main levels of translation:

  • genCompilationUnit() iterates through all the type definitions in the compilation unit. Each generated js.ClassDef is serialized to an .sjsir file.
  • genScalaClass() and other similar methods generate the skeleton of classes.
  • genMethod() and similar methods generate the declarations of methods.
  • genStatOrExpr() and everything else generate the bodies of methods.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
object JSCodeGen

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
JSCodeGen.type
object JSDefinitions

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
final class JSDefinitions()(using x$1: Context)

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
object JSEncoding

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)

Attributes

Authors:

Sébastien Doeraene

Supertypes
class Object
trait Matchable
class Any
Self type
JSEncoding.type
final class JSExportsGen(jsCodeGen: JSCodeGen)(using x$2: Context)

Attributes

Supertypes
class Object
trait Matchable
class Any
class JSPositions()(using x$1: Context)

Conversion utilities from dotty Positions to IR Positions.

Conversion utilities from dotty Positions to IR Positions.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
object JSPositions

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
object JSPrimitives

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
class JSPrimitives(ictx: Context) extends DottyPrimitives

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
class ScopedVar[A](init: A)

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
object ScopedVar

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
ScopedVar.type