Skip to content

Fix XMLHttpRequest.onerror param type: ErrorEvent -> ProgressEvent #437

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 11 commits into from
8 changes: 1 addition & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
scalaversion: ["2.11.12", "2.12.10", "2.13.1"]
scalajsversion: ["1.x", "0.6.x"]
include:
- scalaversion: "2.10.7"
scalajsversion: "0.6.x"
env:
SCALAJS_VERSION: "${{ matrix.scalajsversion == '0.6.x' && '0.6.28' || '' }}"
scalaversion: ["2.11.12", "2.12.12", "2.13.4", "3.0.1"]
steps:
- uses: actions/checkout@v2
- uses: olafurpg/setup-scala@v10
Expand Down
12 changes: 4 additions & 8 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,11 @@ lazy val root = project.in(file(".")).

name := "Scala.js DOM"

crossScalaVersions in ThisBuild := {
if (scalaJSVersion.startsWith("1.")) Seq("2.12.10", "2.11.12", "2.13.1")
else Seq("2.12.10", "2.11.12", "2.10.7", "2.13.1")
}
scalaVersion in ThisBuild := crossScalaVersions.value.head
ThisBuild / crossScalaVersions := Seq("2.12.12", "2.11.12", "2.13.4", "3.0.1")
ThisBuild / scalaVersion := crossScalaVersions.value.head

val commonSettings = Seq(
version := "1.2.0-SNAPSHOT",
version := "2.0.0-SNAPSHOT",
organization := "org.scala-js",
scalacOptions ++= Seq("-deprecation", "-feature", "-Xfatal-warnings")
)
Expand All @@ -36,7 +33,6 @@ scalacOptions ++= {
}

def hasNewCollections(version: String): Boolean = {
!version.startsWith("2.10.") &&
!version.startsWith("2.11.") &&
!version.startsWith("2.12.")
}
Expand Down Expand Up @@ -104,7 +100,7 @@ lazy val readme = ScalatexReadme(
).settings(
scalaVersion := "2.12.10",
scalacOptions ++= Seq("-deprecation", "-feature", "-Xfatal-warnings"),
(resources in Compile) += (fullOptJS in (example, Compile)).value.data
(Compile / resources) += (example / Compile / fullOptJS).value.data
)

lazy val example = project.
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.2.8
sbt.version=1.5.5
2 changes: 1 addition & 1 deletion project/build.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
val scalaJSVersion =
Option(System.getenv("SCALAJS_VERSION")).filter(_ != "").getOrElse("1.0.0")
Option(System.getenv("SCALAJS_VERSION")).filter(_ != "").getOrElse("1.5.0")

addSbtPlugin("org.scala-js" % "sbt-scalajs" % scalaJSVersion)

Expand Down
2 changes: 0 additions & 2 deletions src/main/scala/org/scalajs/dom/crypto/Crypto.scala
Original file line number Diff line number Diff line change
Expand Up @@ -930,10 +930,8 @@ object KeyFormat {
trait RSAPublicKey extends js.Object {

/* modulus, as a base64 URL encoded String */
@js.native
def n: String = js.native

/* exponent, as a base64 URL encoded String */
@js.native
def e: String = js.native
}
58 changes: 29 additions & 29 deletions src/main/scala/org/scalajs/dom/experimental/intl/Intl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,12 @@ object CollatorOptions {
): CollatorOptions = {
js.Dynamic
.literal(
localeMatcher = localeMatcher,
usage = usage,
sensitivity = sensitivity,
ignorePunctuation = ignorePunctuation,
numeric = numeric,
caseFirst = caseFirst
localeMatcher = localeMatcher.asInstanceOf[js.Any],
usage = usage.asInstanceOf[js.Any],
sensitivity = sensitivity.asInstanceOf[js.Any],
ignorePunctuation = ignorePunctuation.asInstanceOf[js.Any],
numeric = numeric.asInstanceOf[js.Any],
caseFirst = caseFirst.asInstanceOf[js.Any]
)
.asInstanceOf[CollatorOptions]
}
Expand Down Expand Up @@ -200,19 +200,19 @@ object DateTimeFormatOptions {
// format: off
js.Dynamic
.literal(
localeMatcher = localeMatcher,
timeZone = timeZone,
hour12 = hour12,
formatMatcher = formatMatcher,
weekday = weekday,
era = era,
year = year,
month = month,
day = day,
hour = hour,
minute = minute,
second = second,
timeZoneName = timeZoneName
localeMatcher = localeMatcher.asInstanceOf[js.Any],
timeZone = timeZone.asInstanceOf[js.Any],
hour12 = hour12.asInstanceOf[js.Any],
formatMatcher = formatMatcher.asInstanceOf[js.Any],
weekday = weekday.asInstanceOf[js.Any],
era = era.asInstanceOf[js.Any],
year = year.asInstanceOf[js.Any],
month = month.asInstanceOf[js.Any],
day = day.asInstanceOf[js.Any],
hour = hour.asInstanceOf[js.Any],
minute = minute.asInstanceOf[js.Any],
second = second.asInstanceOf[js.Any],
timeZoneName = timeZoneName.asInstanceOf[js.Any]
)
.asInstanceOf[DateTimeFormatOptions]
// format: on
Expand Down Expand Up @@ -300,16 +300,16 @@ object NumberFormatOptions {
): NumberFormatOptions = {
js.Dynamic
.literal(
localeMatcher = localeMatcher,
style = style,
currency = currency,
currencyDisplay = currencyDisplay,
useGrouping = useGrouping,
minimumIntegerDigits = minimumIntegerDigits,
minimumFractionDigits = minimumFractionDigits,
maximumFractionDigits = maximumFractionDigits,
minimumSignificantDigits = minimumSignificantDigits,
maximumSignificantDigits = maximumSignificantDigits
localeMatcher = localeMatcher.asInstanceOf[js.Any],
style = style.asInstanceOf[js.Any],
currency = currency.asInstanceOf[js.Any],
currencyDisplay = currencyDisplay.asInstanceOf[js.Any],
useGrouping = useGrouping.asInstanceOf[js.Any],
minimumIntegerDigits = minimumIntegerDigits.asInstanceOf[js.Any],
minimumFractionDigits = minimumFractionDigits.asInstanceOf[js.Any],
maximumFractionDigits = maximumFractionDigits.asInstanceOf[js.Any],
minimumSignificantDigits = minimumSignificantDigits.asInstanceOf[js.Any],
maximumSignificantDigits = maximumSignificantDigits.asInstanceOf[js.Any]
)
.asInstanceOf[NumberFormatOptions]
}
Expand Down
13 changes: 8 additions & 5 deletions src/main/scala/org/scalajs/dom/ext/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,20 @@ package object ext {
def cast[T] = x.asInstanceOf[T]
}

implicit def pimpAnimatedNumber(x: svg.AnimatedNumber) = x.baseVal
implicit def pimpAnimatedNumber(x: svg.AnimatedNumber): Double = x.baseVal

implicit def pimpRichAnimatedNumber(x: svg.AnimatedNumber) =
implicit def pimpRichAnimatedNumber(
x: svg.AnimatedNumber): runtime.RichDouble =
x.baseVal: runtime.RichDouble

implicit def pimpAnimatedLength(x: svg.AnimatedLength) = x.baseVal.value
implicit def pimpAnimatedLength(x: svg.AnimatedLength): Double =
x.baseVal.value

implicit def pimpRichAnimatedLength(x: svg.AnimatedLength) =
implicit def pimpRichAnimatedLength(
x: svg.AnimatedLength): runtime.RichDouble =
x.baseVal.value: runtime.RichDouble

implicit def color2String(c: Color) = c.toString
implicit def color2String(c: Color): String = c.toString
implicit class pimpedContext(val ctx: CanvasRenderingContext2D) {
def prepCircle(x: Double, y: Double, r: Double) = {
ctx.beginPath()
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/org/scalajs/dom/raw/lib.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4181,7 +4181,7 @@ class XMLHttpRequest extends EventTarget {
* MDN
*/
var upload: XMLHttpRequestEventTarget = js.native
var onerror: js.Function1[ErrorEvent, _] = js.native
var onerror: js.Function1[ProgressEvent, _] = js.native
var onloadstart: js.Function1[js.Any, _] = js.native
}

Expand Down