Skip to content

Commit

Permalink
Upgrade to Scala.js 1.6.0.
Browse files Browse the repository at this point in the history
This includes changes in the compiler and build from the following
upstream commits:

* scala-js/scala-js@c4aa18b
  Allow to specify target versions of ECMAScript > 2015.
* scala-js/scala-js@89dfc48
  Use a dedicated function for Long-to-Float conversions.
  • Loading branch information
sjrd committed Aug 23, 2021
1 parent 3508a49 commit 2b615f5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion compiler/src/dotty/tools/backend/sjs/JSCodeGen.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2633,7 +2633,10 @@ class JSCodeGen()(using genCtx: Context) {
js.UnaryOp(IntToLong, intValue)
}
case jstpe.FloatType =>
js.UnaryOp(js.UnaryOp.DoubleToFloat, doubleValue)
if (from == jstpe.LongType)
js.UnaryOp(js.UnaryOp.LongToFloat, value)
else
js.UnaryOp(js.UnaryOp.DoubleToFloat, doubleValue)
case jstpe.DoubleType =>
doubleValue
}
Expand Down
3 changes: 2 additions & 1 deletion project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1160,7 +1160,8 @@ object Build {
"compliantModuleInit" -> (sems.moduleInit == CheckedBehavior.Compliant),
"strictFloats" -> sems.strictFloats,
"productionMode" -> sems.productionMode,
"es2015" -> linkerConfig.esFeatures.useECMAScript2015,
"esVersion" -> linkerConfig.esFeatures.esVersion.edition,
"useECMAScript2015Semantics" -> linkerConfig.esFeatures.useECMAScript2015Semantics,
)
}.taskValue,

Expand Down
1 change: 1 addition & 0 deletions project/ConstantHolderGenerator.scala
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ object ConstantHolderGenerator {
private final def literal(v: Any): String = v match {
case s: String => "raw\"\"\"" + s + "\"\"\""
case b: Boolean => b.toString
case i: Int => i.toString
case f: File => literal(f.getAbsolutePath)

case _ =>
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.5.1")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.6.0")

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

Expand Down

0 comments on commit 2b615f5

Please sign in to comment.