Skip to content

Commit 0d90d6d

Browse files
committed
Add support for Scala 3
Co-authored by: Russ White <[email protected]>
1 parent 25da49e commit 0d90d6d

File tree

4 files changed

+37
-35
lines changed

4 files changed

+37
-35
lines changed

.github/workflows/ci.yml

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
include:
1818
- scalaversion: "2.10.7"
1919
scalajsversion: "0.6.x"
20+
- scalaversion: "3.0.1"
21+
scalajsversion: "1.x"
2022
env:
2123
SCALAJS_VERSION: "${{ matrix.scalajsversion == '0.6.x' && '0.6.28' || '' }}"
2224
steps:

build.sbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ lazy val root = project.in(file(".")).
66
name := "Scala.js DOM"
77

88
ThisBuild / crossScalaVersions := {
9-
if (scalaJSVersion.startsWith("1.")) Seq("2.12.10", "2.11.12", "2.13.1")
9+
if (scalaJSVersion.startsWith("1.")) Seq("2.12.10", "2.11.12", "2.13.1", "3.0.1")
1010
else Seq("2.12.10", "2.11.12", "2.10.7", "2.13.1")
1111
}
1212
ThisBuild / scalaVersion := crossScalaVersions.value.head

src/main/scala/org/scalajs/dom/experimental/intl/Intl.scala

+29-29
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,12 @@ object CollatorOptions {
123123
): CollatorOptions = {
124124
js.Dynamic
125125
.literal(
126-
localeMatcher = localeMatcher,
127-
usage = usage,
128-
sensitivity = sensitivity,
129-
ignorePunctuation = ignorePunctuation,
130-
numeric = numeric,
131-
caseFirst = caseFirst
126+
localeMatcher = localeMatcher.asInstanceOf[js.Any],
127+
usage = usage.asInstanceOf[js.Any],
128+
sensitivity = sensitivity.asInstanceOf[js.Any],
129+
ignorePunctuation = ignorePunctuation.asInstanceOf[js.Any],
130+
numeric = numeric.asInstanceOf[js.Any],
131+
caseFirst = caseFirst.asInstanceOf[js.Any]
132132
)
133133
.asInstanceOf[CollatorOptions]
134134
}
@@ -200,19 +200,19 @@ object DateTimeFormatOptions {
200200
// format: off
201201
js.Dynamic
202202
.literal(
203-
localeMatcher = localeMatcher,
204-
timeZone = timeZone,
205-
hour12 = hour12,
206-
formatMatcher = formatMatcher,
207-
weekday = weekday,
208-
era = era,
209-
year = year,
210-
month = month,
211-
day = day,
212-
hour = hour,
213-
minute = minute,
214-
second = second,
215-
timeZoneName = timeZoneName
203+
localeMatcher = localeMatcher.asInstanceOf[js.Any],
204+
timeZone = timeZone.asInstanceOf[js.Any],
205+
hour12 = hour12.asInstanceOf[js.Any],
206+
formatMatcher = formatMatcher.asInstanceOf[js.Any],
207+
weekday = weekday.asInstanceOf[js.Any],
208+
era = era.asInstanceOf[js.Any],
209+
year = year.asInstanceOf[js.Any],
210+
month = month.asInstanceOf[js.Any],
211+
day = day.asInstanceOf[js.Any],
212+
hour = hour.asInstanceOf[js.Any],
213+
minute = minute.asInstanceOf[js.Any],
214+
second = second.asInstanceOf[js.Any],
215+
timeZoneName = timeZoneName.asInstanceOf[js.Any]
216216
)
217217
.asInstanceOf[DateTimeFormatOptions]
218218
// format: on
@@ -300,16 +300,16 @@ object NumberFormatOptions {
300300
): NumberFormatOptions = {
301301
js.Dynamic
302302
.literal(
303-
localeMatcher = localeMatcher,
304-
style = style,
305-
currency = currency,
306-
currencyDisplay = currencyDisplay,
307-
useGrouping = useGrouping,
308-
minimumIntegerDigits = minimumIntegerDigits,
309-
minimumFractionDigits = minimumFractionDigits,
310-
maximumFractionDigits = maximumFractionDigits,
311-
minimumSignificantDigits = minimumSignificantDigits,
312-
maximumSignificantDigits = maximumSignificantDigits
303+
localeMatcher = localeMatcher.asInstanceOf[js.Any],
304+
style = style.asInstanceOf[js.Any],
305+
currency = currency.asInstanceOf[js.Any],
306+
currencyDisplay = currencyDisplay.asInstanceOf[js.Any],
307+
useGrouping = useGrouping.asInstanceOf[js.Any],
308+
minimumIntegerDigits = minimumIntegerDigits.asInstanceOf[js.Any],
309+
minimumFractionDigits = minimumFractionDigits.asInstanceOf[js.Any],
310+
maximumFractionDigits = maximumFractionDigits.asInstanceOf[js.Any],
311+
minimumSignificantDigits = minimumSignificantDigits.asInstanceOf[js.Any],
312+
maximumSignificantDigits = maximumSignificantDigits.asInstanceOf[js.Any]
313313
)
314314
.asInstanceOf[NumberFormatOptions]
315315
}

src/main/scala/org/scalajs/dom/ext/package.scala

+5-5
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@ package object ext {
2222
def cast[T] = x.asInstanceOf[T]
2323
}
2424

25-
implicit def pimpAnimatedNumber(x: svg.AnimatedNumber) = x.baseVal
25+
implicit def pimpAnimatedNumber(x: svg.AnimatedNumber): Double = x.baseVal
2626

27-
implicit def pimpRichAnimatedNumber(x: svg.AnimatedNumber) =
27+
implicit def pimpRichAnimatedNumber(x: svg.AnimatedNumber): runtime.RichDouble =
2828
x.baseVal: runtime.RichDouble
2929

30-
implicit def pimpAnimatedLength(x: svg.AnimatedLength) = x.baseVal.value
30+
implicit def pimpAnimatedLength(x: svg.AnimatedLength): Double = x.baseVal.value
3131

32-
implicit def pimpRichAnimatedLength(x: svg.AnimatedLength) =
32+
implicit def pimpRichAnimatedLength(x: svg.AnimatedLength): runtime.RichDouble =
3333
x.baseVal.value: runtime.RichDouble
3434

35-
implicit def color2String(c: Color) = c.toString
35+
implicit def color2String(c: Color): String = c.toString
3636
implicit class pimpedContext(val ctx: CanvasRenderingContext2D) {
3737
def prepCircle(x: Double, y: Double, r: Double) = {
3838
ctx.beginPath()

0 commit comments

Comments
 (0)