Skip to content

Commit 9ee3b46

Browse files
committed
Prefer val to inline def for constants
1 parent 993c4d1 commit 9ee3b46

File tree

8 files changed

+40
-40
lines changed

8 files changed

+40
-40
lines changed

api-reports/2_12.txt

+10-10
Original file line numberDiff line numberDiff line change
@@ -13972,10 +13972,10 @@ IDBCursor[JC] def primaryKey: IDBKey
1397213972
IDBCursor[JC] def source: S
1397313973
IDBCursor[JC] def update(value: IDBValue): IDBRequest[S, IDBKey]
1397413974
IDBCursorDirection[JT]
13975-
IDBCursorDirection[SO] def next: IDBCursorDirection
13976-
IDBCursorDirection[SO] def nextunique: IDBCursorDirection
13977-
IDBCursorDirection[SO] def prev: IDBCursorDirection
13978-
IDBCursorDirection[SO] def prevunique: IDBCursorDirection
13975+
IDBCursorDirection[SO] val next: IDBCursorDirection
13976+
IDBCursorDirection[SO] val nextunique: IDBCursorDirection
13977+
IDBCursorDirection[SO] val prev: IDBCursorDirection
13978+
IDBCursorDirection[SO] val prevunique: IDBCursorDirection
1397913979
IDBCursorReadOnly[JC] def advance(count: Double): Unit
1398013980
IDBCursorReadOnly[JC] def continue(key: IDBKey?): Unit
1398113981
IDBCursorReadOnly[JC] def direction: IDBCursorDirection
@@ -14120,13 +14120,13 @@ IDBTransaction[JC] var onerror: js.Function1[Event, _]
1412014120
IDBTransaction[JC] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit
1412114121
IDBTransaction[JC] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit
1412214122
IDBTransactionDurability[JT]
14123-
IDBTransactionDurability[SO] def default: IDBTransactionDurability
14124-
IDBTransactionDurability[SO] def relaxed: IDBTransactionDurability
14125-
IDBTransactionDurability[SO] def strict: IDBTransactionDurability
14123+
IDBTransactionDurability[SO] val default: IDBTransactionDurability
14124+
IDBTransactionDurability[SO] val relaxed: IDBTransactionDurability
14125+
IDBTransactionDurability[SO] val strict: IDBTransactionDurability
1412614126
IDBTransactionMode[JT]
14127-
IDBTransactionMode[SO] def readonly: IDBTransactionMode
14128-
IDBTransactionMode[SO] def readwrite: IDBTransactionMode
14129-
IDBTransactionMode[SO] def versionchange: IDBTransactionMode
14127+
IDBTransactionMode[SO] val readonly: IDBTransactionMode
14128+
IDBTransactionMode[SO] val readwrite: IDBTransactionMode
14129+
IDBTransactionMode[SO] val versionchange: IDBTransactionMode
1413014130
IDBTransactionOptions[JT] val durability: js.UndefOr[IDBTransactionDurability]
1413114131
IDBVersionChangeEvent[JC] def bubbles: Boolean
1413214132
IDBVersionChangeEvent[JC] def cancelBubble: Boolean

api-reports/2_13.txt

+10-10
Original file line numberDiff line numberDiff line change
@@ -13972,10 +13972,10 @@ IDBCursor[JC] def primaryKey: IDBKey
1397213972
IDBCursor[JC] def source: S
1397313973
IDBCursor[JC] def update(value: IDBValue): IDBRequest[S, IDBKey]
1397413974
IDBCursorDirection[JT]
13975-
IDBCursorDirection[SO] def next: IDBCursorDirection
13976-
IDBCursorDirection[SO] def nextunique: IDBCursorDirection
13977-
IDBCursorDirection[SO] def prev: IDBCursorDirection
13978-
IDBCursorDirection[SO] def prevunique: IDBCursorDirection
13975+
IDBCursorDirection[SO] val next: IDBCursorDirection
13976+
IDBCursorDirection[SO] val nextunique: IDBCursorDirection
13977+
IDBCursorDirection[SO] val prev: IDBCursorDirection
13978+
IDBCursorDirection[SO] val prevunique: IDBCursorDirection
1397913979
IDBCursorReadOnly[JC] def advance(count: Double): Unit
1398013980
IDBCursorReadOnly[JC] def continue(key: IDBKey?): Unit
1398113981
IDBCursorReadOnly[JC] def direction: IDBCursorDirection
@@ -14120,13 +14120,13 @@ IDBTransaction[JC] var onerror: js.Function1[Event, _]
1412014120
IDBTransaction[JC] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit
1412114121
IDBTransaction[JC] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit
1412214122
IDBTransactionDurability[JT]
14123-
IDBTransactionDurability[SO] def default: IDBTransactionDurability
14124-
IDBTransactionDurability[SO] def relaxed: IDBTransactionDurability
14125-
IDBTransactionDurability[SO] def strict: IDBTransactionDurability
14123+
IDBTransactionDurability[SO] val default: IDBTransactionDurability
14124+
IDBTransactionDurability[SO] val relaxed: IDBTransactionDurability
14125+
IDBTransactionDurability[SO] val strict: IDBTransactionDurability
1412614126
IDBTransactionMode[JT]
14127-
IDBTransactionMode[SO] def readonly: IDBTransactionMode
14128-
IDBTransactionMode[SO] def readwrite: IDBTransactionMode
14129-
IDBTransactionMode[SO] def versionchange: IDBTransactionMode
14127+
IDBTransactionMode[SO] val readonly: IDBTransactionMode
14128+
IDBTransactionMode[SO] val readwrite: IDBTransactionMode
14129+
IDBTransactionMode[SO] val versionchange: IDBTransactionMode
1413014130
IDBTransactionOptions[JT] val durability: js.UndefOr[IDBTransactionDurability]
1413114131
IDBVersionChangeEvent[JC] def bubbles: Boolean
1413214132
IDBVersionChangeEvent[JC] def cancelBubble: Boolean

src/main/scala-2/org/scalajs/dom/IDBCursorDirection.scala

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,20 @@ object IDBCursorDirection {
1616
/** The cursor shows all records, including duplicates. It starts at the upper bound of the key range and moves
1717
* downwards (monotonically decreasing in the order of keys).
1818
*/
19-
@inline def prev: IDBCursorDirection = "prev".asInstanceOf[IDBCursorDirection]
19+
val prev: IDBCursorDirection = "prev".asInstanceOf[IDBCursorDirection]
2020

2121
/** The cursor shows all records, excluding duplicates. If multiple records exist with the same key, only the first
2222
* one iterated is retrieved. It starts at the upper bound of the key range and moves downwards.
2323
*/
24-
@inline def prevunique: IDBCursorDirection = "prevunique".asInstanceOf[IDBCursorDirection]
24+
val prevunique: IDBCursorDirection = "prevunique".asInstanceOf[IDBCursorDirection]
2525

2626
/** The cursor shows all records, including duplicates. It starts at the lower bound of the key range and moves
2727
* upwards (monotonically increasing in the order of keys).
2828
*/
29-
@inline def next: IDBCursorDirection = "next".asInstanceOf[IDBCursorDirection]
29+
val next: IDBCursorDirection = "next".asInstanceOf[IDBCursorDirection]
3030

3131
/** The cursor shows all records, excluding duplicates. If multiple records exist with the same key, only the first
3232
* one iterated is retrieved. It starts at the lower bound of the key range and moves upwards.
3333
*/
34-
@inline def nextunique: IDBCursorDirection = "nextunique".asInstanceOf[IDBCursorDirection]
34+
val nextunique: IDBCursorDirection = "nextunique".asInstanceOf[IDBCursorDirection]
3535
}

src/main/scala-2/org/scalajs/dom/IDBTransactionDurability.scala

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import scala.scalajs.js
1212
sealed trait IDBTransactionDurability extends js.Any
1313

1414
object IDBTransactionDurability {
15-
@inline def default: IDBTransactionDurability = "default".asInstanceOf[IDBTransactionDurability]
16-
@inline def strict: IDBTransactionDurability = "strict".asInstanceOf[IDBTransactionDurability]
17-
@inline def relaxed: IDBTransactionDurability = "relaxed".asInstanceOf[IDBTransactionDurability]
15+
val default: IDBTransactionDurability = "default".asInstanceOf[IDBTransactionDurability]
16+
val strict: IDBTransactionDurability = "strict".asInstanceOf[IDBTransactionDurability]
17+
val relaxed: IDBTransactionDurability = "relaxed".asInstanceOf[IDBTransactionDurability]
1818
}

src/main/scala-2/org/scalajs/dom/IDBTransactionMode.scala

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ sealed trait IDBTransactionMode extends js.Any
1717
object IDBTransactionMode {
1818

1919
/** Allows data to be read but not changed. It is the default transaction mode. */
20-
@inline def readonly: IDBTransactionMode = "readonly".asInstanceOf[IDBTransactionMode]
20+
val readonly: IDBTransactionMode = "readonly".asInstanceOf[IDBTransactionMode]
2121

2222
/** Allows any operation to be performed, including ones that delete and create object stores and indexes. This mode
2323
* is for updating the version number of transactions that were started using the setVersion() method of IDBDatabase
2424
* objects. Transactions of this mode cannot run concurrently with other transactions.
2525
*/
26-
@inline def versionchange: IDBTransactionMode = "versionchange".asInstanceOf[IDBTransactionMode]
26+
val versionchange: IDBTransactionMode = "versionchange".asInstanceOf[IDBTransactionMode]
2727

2828
/** Allows reading and writing of data in existing data stores to be changed. */
29-
@inline def readwrite: IDBTransactionMode = "readwrite".asInstanceOf[IDBTransactionMode]
29+
val readwrite: IDBTransactionMode = "readwrite".asInstanceOf[IDBTransactionMode]
3030
}

src/main/scala-3/org/scalajs/dom/IDBCursorDirection.scala

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,20 @@ object IDBCursorDirection {
1515
/** The cursor shows all records, including duplicates. It starts at the upper bound of the key range and moves
1616
* downwards (monotonically decreasing in the order of keys).
1717
*/
18-
@inline def prev: IDBCursorDirection = "prev"
18+
val prev: IDBCursorDirection = "prev"
1919

2020
/** The cursor shows all records, excluding duplicates. If multiple records exist with the same key, only the first
2121
* one iterated is retrieved. It starts at the upper bound of the key range and moves downwards.
2222
*/
23-
@inline def prevunique: IDBCursorDirection = "prevunique"
23+
val prevunique: IDBCursorDirection = "prevunique"
2424

2525
/** The cursor shows all records, including duplicates. It starts at the lower bound of the key range and moves
2626
* upwards (monotonically increasing in the order of keys).
2727
*/
28-
@inline def next: IDBCursorDirection = "next"
28+
val next: IDBCursorDirection = "next"
2929

3030
/** The cursor shows all records, excluding duplicates. If multiple records exist with the same key, only the first
3131
* one iterated is retrieved. It starts at the lower bound of the key range and moves upwards.
3232
*/
33-
@inline def nextunique: IDBCursorDirection = "nextunique"
33+
val nextunique: IDBCursorDirection = "nextunique"
3434
}

src/main/scala-3/org/scalajs/dom/IDBTransactionDurability.scala

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import scala.scalajs.js
1111
opaque type IDBTransactionDurability = String
1212

1313
object IDBTransactionDurability {
14-
@inline def default: IDBTransactionDurability = "default"
15-
@inline def strict: IDBTransactionDurability = "strict"
16-
@inline def relaxed: IDBTransactionDurability = "relaxed"
14+
val default: IDBTransactionDurability = "default"
15+
val strict: IDBTransactionDurability = "strict"
16+
val relaxed: IDBTransactionDurability = "relaxed"
1717
}

src/main/scala-3/org/scalajs/dom/IDBTransactionMode.scala

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ opaque type IDBTransactionMode = String
1616
object IDBTransactionMode {
1717

1818
/** Allows data to be read but not changed. It is the default transaction mode. */
19-
@inline def readonly: IDBTransactionMode = "readonly"
19+
val readonly: IDBTransactionMode = "readonly"
2020

2121
/** Allows any operation to be performed, including ones that delete and create object stores and indexes. This mode
2222
* is for updating the version number of transactions that were started using the setVersion() method of IDBDatabase
2323
* objects. Transactions of this mode cannot run concurrently with other transactions.
2424
*/
25-
@inline def versionchange: IDBTransactionMode = "versionchange"
25+
val versionchange: IDBTransactionMode = "versionchange"
2626

2727
/** Allows reading and writing of data in existing data stores to be changed. */
28-
@inline def readwrite: IDBTransactionMode = "readwrite"
28+
val readwrite: IDBTransactionMode = "readwrite"
2929
}

0 commit comments

Comments
 (0)