Skip to content

Commit

Permalink
Upgrade to Scala.js 1.12.0.
Browse files Browse the repository at this point in the history
We omit in this commit the upstream changes to add support for
`@JSOperator`, from the PR
scala-js/scala-js#4744
Doing so does not prevent the test suite from passing at the
moment. We leave them for an upcoming PR.
  • Loading branch information
sjrd committed Nov 25, 2022
1 parent ffd1e9d commit 7c2be61
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
13 changes: 10 additions & 3 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -522,9 +522,6 @@ object Build {

// Settings shared between scala3-compiler and scala3-compiler-bootstrapped
lazy val commonDottyCompilerSettings = Seq(
// Temporary for the upgrade to Scala.js 1.11.0 - remove with Scala.js 1.12.0
Compile / scalacOptions -= "-Xfatal-warnings",

// Generate compiler.properties, used by sbt
(Compile / resourceGenerators) += Def.task {
import java.util._
Expand Down Expand Up @@ -1195,6 +1192,8 @@ object Build {
"isFullOpt" -> (stage == FullOptStage),
"compliantAsInstanceOfs" -> (sems.asInstanceOfs == CheckedBehavior.Compliant),
"compliantArrayIndexOutOfBounds" -> (sems.arrayIndexOutOfBounds == CheckedBehavior.Compliant),
"compliantArrayStores" -> (sems.arrayStores == CheckedBehavior.Compliant),
"compliantNegativeArraySizes" -> (sems.negativeArraySizes == CheckedBehavior.Compliant),
"compliantStringIndexOutOfBounds" -> (sems.stringIndexOutOfBounds == CheckedBehavior.Compliant),
"compliantModuleInit" -> (sems.moduleInit == CheckedBehavior.Compliant),
"strictFloats" -> sems.strictFloats,
Expand Down Expand Up @@ -1272,6 +1271,14 @@ object Build {
)
},

/* For some reason, in Scala 3, the implementation of IterableDefaultTest
* resolves to `scala.collection.ArrayOps.ArrayIterator`, whose `next()`
* method is not compliant when called past the last element on Scala.js.
* It relies on catching an `ArrayIndexOutOfBoundsException`.
* We have to ignore it here.
*/
Test / testOptions := Seq(Tests.Filter(_ != "org.scalajs.testsuite.javalib.lang.IterableDefaultTest")),

Test / managedResources ++= {
val testDir = fetchScalaJSSource.value / "test-suite/js/src/test"

Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// e.g. addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.1.0")

addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.11.0")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.12.0")

addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.10")

Expand Down

0 comments on commit 7c2be61

Please sign in to comment.