Skip to content

Commit 7ddf329

Browse files
authored
Upgrade to Scala.js 1.20.2. (scala#24898)
And forward-port scala-js/scala-js#5288
2 parents 82ad088 + 1989025 commit 7ddf329

File tree

3 files changed

+45
-2
lines changed

3 files changed

+45
-2
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* Scala (https://www.scala-lang.org)
3+
*
4+
* Copyright EPFL and Lightbend, Inc. dba Akka
5+
*
6+
* Licensed under Apache License 2.0
7+
* (http://www.apache.org/licenses/LICENSE-2.0).
8+
*
9+
* See the NOTICE file distributed with this work for
10+
* additional information regarding copyright ownership.
11+
*/
12+
13+
package scala
14+
15+
/** This class implements errors which are thrown whenever an
16+
* object doesn't match any pattern of a pattern matching
17+
* expression.
18+
*/
19+
final class MatchError(@transient obj: Any) extends RuntimeException {
20+
/** There's no reason we need to call toString eagerly,
21+
* so defer it until getMessage is called or object is serialized
22+
*/
23+
private[this] lazy val objString = {
24+
if (obj == null) "null"
25+
else {
26+
val cls = obj.getClass()
27+
val ofClass =
28+
if (cls == null) "of a JS class"
29+
else s"of class ${cls.getName()}"
30+
try s"$obj ($ofClass)"
31+
catch {
32+
case _: Throwable => "an instance " + ofClass
33+
}
34+
}
35+
}
36+
37+
@throws[java.io.ObjectStreamException]
38+
private def writeReplace(): Object = {
39+
objString
40+
this
41+
}
42+
43+
override def getMessage() = objString
44+
}

project/plugins.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
libraryDependencySchemes +=
77
"org.scala-lang.modules" %% "scala-xml" % VersionScheme.Always
88

9-
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.20.1")
9+
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.20.2")
1010

1111
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.2.1")
1212

tests/run/classTags.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// scalajs: --skip --pending
21
object Test {
32
type T = String
43

0 commit comments

Comments
 (0)