Skip to content

Commit 3521a6f

Browse files
committed
IDBVersionChangeEvent.newVersion can be null
1 parent 5a502ad commit 3521a6f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/main/scala/org/scalajs/dom/raw/Idb.scala

+5-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
package org.scalajs.dom.raw
1111

1212
import scala.scalajs.js
13+
import scala.scalajs.js.|
1314
import scala.scalajs.js.annotation._
1415

1516
/**
@@ -123,7 +124,7 @@ class IDBObjectStore extends js.Object {
123124
}
124125

125126
trait IDBVersionChangeEventInit extends EventInit {
126-
var newVersion: js.UndefOr[Int] = js.undefined
127+
var newVersion: js.UndefOr[Int | Null] = js.undefined
127128
var oldVersion: js.UndefOr[Int] = js.undefined
128129
}
129130

@@ -142,9 +143,11 @@ class IDBVersionChangeEvent(typeArg: String,
142143
/**
143144
* Returns the new version of the database.
144145
*
146+
* This is null when the database is being deleted.
147+
*
145148
* MDN
146149
*/
147-
def newVersion: Int = js.native
150+
def newVersion: Int | Null = js.native
148151

149152
/**
150153
* Returns the old version of the database.

0 commit comments

Comments
 (0)