Skip to content

Commit fb1c3c0

Browse files
authored
Merge pull request #10423 from dotty-staging/scalajs-1.3.1
Upgrade to Scala.js 1.3.1.
2 parents b121901 + a696882 commit fb1c3c0

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

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

+8-12
Original file line numberDiff line numberDiff line change
@@ -1048,9 +1048,6 @@ class JSCodeGen()(using genCtx: Context) {
10481048
"Malformed parameter list: " + vparamss)
10491049
val params = if (vparamss.isEmpty) Nil else vparamss.head.map(_.symbol)
10501050

1051-
val isJSClassConstructor =
1052-
sym.isClassConstructor && currentClassSym.isNonNativeJSClass
1053-
10541051
val methodName = encodeMethodSym(sym)
10551052
val originalName = originalNameOfMethod(sym)
10561053

@@ -1089,18 +1086,17 @@ class JSCodeGen()(using genCtx: Context) {
10891086
}
10901087

10911088
val methodDef = {
1092-
if (isJSClassConstructor) {
1089+
if (sym.isClassConstructor) {
10931090
val body0 = genStat(rhs)
1094-
val body1 =
1095-
if (!sym.isPrimaryConstructor) body0
1096-
else moveAllStatementsAfterSuperConstructorCall(body0)
1097-
js.MethodDef(js.MemberFlags.empty, methodName, originalName,
1098-
jsParams, jstpe.NoType, Some(body1))(optimizerHints, None)
1099-
} else if (sym.isClassConstructor) {
1091+
val body1 = {
1092+
val needsMove = currentClassSym.isNonNativeJSClass && sym.isPrimaryConstructor
1093+
if (needsMove) moveAllStatementsAfterSuperConstructorCall(body0)
1094+
else body0
1095+
}
11001096
val namespace = js.MemberNamespace.Constructor
11011097
js.MethodDef(js.MemberFlags.empty.withNamespace(namespace),
1102-
methodName, originalName, jsParams, jstpe.NoType,
1103-
Some(genStat(rhs)))(optimizerHints, None)
1098+
methodName, originalName, jsParams, jstpe.NoType, Some(body1))(
1099+
optimizerHints, None)
11041100
} else {
11051101
val namespace = if (isMethodStaticInIR(sym)) {
11061102
if (sym.isPrivate) js.MemberNamespace.PrivateStatic

project/plugins.sbt

+1-1
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.3.0")
5+
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.3.1")
66

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

0 commit comments

Comments
 (0)