Skip to content

Commit 8dd5a92

Browse files
sjrdsmarter
authored andcommitted
Upgrade to Scala.js 1.6.0.
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.
1 parent 5092141 commit 8dd5a92

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

compiler/src/dotty/tools/backend/sjs/JSCodeGen.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2633,7 +2633,10 @@ class JSCodeGen()(using genCtx: Context) {
26332633
js.UnaryOp(IntToLong, intValue)
26342634
}
26352635
case jstpe.FloatType =>
2636-
js.UnaryOp(js.UnaryOp.DoubleToFloat, doubleValue)
2636+
if (from == jstpe.LongType)
2637+
js.UnaryOp(js.UnaryOp.LongToFloat, value)
2638+
else
2639+
js.UnaryOp(js.UnaryOp.DoubleToFloat, doubleValue)
26372640
case jstpe.DoubleType =>
26382641
doubleValue
26392642
}

project/Build.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1160,7 +1160,8 @@ object Build {
11601160
"compliantModuleInit" -> (sems.moduleInit == CheckedBehavior.Compliant),
11611161
"strictFloats" -> sems.strictFloats,
11621162
"productionMode" -> sems.productionMode,
1163-
"es2015" -> linkerConfig.esFeatures.useECMAScript2015,
1163+
"esVersion" -> linkerConfig.esFeatures.esVersion.edition,
1164+
"useECMAScript2015Semantics" -> linkerConfig.esFeatures.useECMAScript2015Semantics,
11641165
)
11651166
}.taskValue,
11661167

project/ConstantHolderGenerator.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ object ConstantHolderGenerator {
3535
private final def literal(v: Any): String = v match {
3636
case s: String => "raw\"\"\"" + s + "\"\"\""
3737
case b: Boolean => b.toString
38+
case i: Int => i.toString
3839
case f: File => literal(f.getAbsolutePath)
3940

4041
case _ =>

project/plugins.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// e.g. addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.1.0")
44

5-
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.5.1")
5+
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.6.0")
66

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

0 commit comments

Comments
 (0)