Skip to content

Commit a1732c2

Browse files
authored
Merge pull request #9705 from dotty-staging/sjs-transform-in-sjs-package
Move Scala.js-specific transforms to the subpackage transform.sjs.
2 parents e1f89fb + 5dc26f5 commit a1732c2

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

compiler/src/dotty/tools/dotc/Compiler.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import typer.{FrontEnd, RefChecks}
77
import Phases.Phase
88
import transform._
99
import dotty.tools.backend.jvm.{CollectSuperCalls, GenBCode}
10-
import dotty.tools.backend.sjs
10+
import dotty.tools.backend
1111
import dotty.tools.dotc.transform.localopt.StringInterpolatorOpt
1212

1313
/** The central class of the dotc compiler. The job of a compiler is to create
@@ -72,7 +72,7 @@ class Compiler {
7272
List(new ElimOpaque, // Turn opaque into normal aliases
7373
new TryCatchPatterns, // Compile cases in try/catch
7474
new PatternMatcher, // Compile pattern matches
75-
new ExplicitJSClasses, // Make all JS classes explicit (Scala.js only)
75+
new sjs.ExplicitJSClasses, // Make all JS classes explicit (Scala.js only)
7676
new ExplicitOuter, // Add accessors to outer classes from nested ones.
7777
new ExplicitSelf, // Make references to non-trivial self types explicit as casts
7878
new StringInterpolatorOpt, // Optimizes raw and s string interpolators by rewriting them to string concatentations
@@ -128,8 +128,8 @@ class Compiler {
128128

129129
/** Generate the output of the compilation */
130130
protected def backendPhases: List[List[Phase]] =
131-
List(new sjs.GenSJSIR) :: // Generate .sjsir files for Scala.js (not enabled by default)
132-
List(new GenBCode) :: // Generate JVM bytecode
131+
List(new backend.sjs.GenSJSIR) :: // Generate .sjsir files for Scala.js (not enabled by default)
132+
List(new GenBCode) :: // Generate JVM bytecode
133133
Nil
134134

135135
var runId: Int = 1

compiler/src/dotty/tools/dotc/transform/ExplicitJSClasses.scala renamed to compiler/src/dotty/tools/dotc/transform/sjs/ExplicitJSClasses.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package dotty.tools
22
package dotc
33
package transform
4+
package sjs
45

56
import MegaPhase._
67
import core.DenotTransformers._

compiler/src/dotty/tools/backend/sjs/JUnitBootstrappers.scala renamed to compiler/src/dotty/tools/dotc/transform/sjs/JUnitBootstrappers.scala

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
package dotty.tools.backend.sjs
1+
package dotty.tools.dotc
2+
package transform
3+
package sjs
24

35
import scala.annotation.tailrec
46

5-
import dotty.tools.dotc._
6-
77
import dotty.tools.dotc.core._
88
import Constants._
99
import Contexts._
@@ -19,6 +19,8 @@ import Types._
1919

2020
import dotty.tools.dotc.transform.MegaPhase._
2121

22+
import dotty.tools.backend.sjs.JSDefinitions.jsdefn
23+
2224
/** Generates JUnit bootstrapper objects for Scala.js.
2325
*
2426
* On the JVM, JUnit uses run-time reflection to list and invoke JUnit-related
@@ -108,7 +110,6 @@ import dotty.tools.dotc.transform.MegaPhase._
108110
class JUnitBootstrappers extends MiniPhase {
109111
import JUnitBootstrappers._
110112
import ast.tpd._
111-
import JSDefinitions.jsdefn
112113

113114
def phaseName: String = "junitBootstrappers"
114115

0 commit comments

Comments
 (0)