@@ -103,7 +103,7 @@ Currently known exhaustive list of exceptions are:
103
103
* ` NullPointerException `
104
104
* ` ArrayIndexOutOfBoundsException ` and ` StringIndexOutOfBoundsException `
105
105
* ` ClassCastException `
106
- * ` ArithmeticException ` (such as integer division by 0)
106
+ * ` ArrayStoreException `
107
107
* ` StackOverflowError ` and other ` VirtualMachineError ` s
108
108
109
109
Because Scala.js does not receive VM support to detect such erroneous
@@ -112,18 +112,20 @@ conditions, checking them is typically too expensive.
112
112
Therefore, all of these are considered
113
113
[ undefined behavior] ( http://en.wikipedia.org/wiki/Undefined_behavior ) .
114
114
115
+ ** Scala.js 0.6.x only:**
116
+ In Scala.js 0.6.x, ` ArithmeticException ` s, such as integer division by 0, are also considered undefined behavior.
117
+ This is not the case in Scala.js 1.x anymore, where they are reliably thrown.
118
+
115
119
Some of these, however, can be configured to be compliant with the JVM
116
120
specification using sbt settings.
117
- Currently, only ` ClassCastException ` s (thrown by invalid ` asInstanceOf ` calls)
121
+ Currently, only ` ClassCastException ` s (thrown by invalid ` asInstanceOf ` calls) and ` ArrayIndexOutOfBoundsException ` s (thrown by array indexing)
118
122
are configurable, but the list will probably expand in future versions.
119
123
120
124
Every configurable undefined behavior has 3 possible modes:
121
125
122
126
* ` Compliant ` : behaves as specified on a JVM
123
127
* ` Unchecked ` : completely unchecked and undefined
124
- * ` Fatal ` : checked, but throws
125
- [ ` UndefinedBehaviorError ` s] ({{ site.production_url }}/api/scalajs-library/{{ site.versions.scalaJS }}/#scala.scalajs.runtime.UndefinedBehaviorError)
126
- instead of the specified exception.
128
+ * ` Fatal ` : checked, but throws ` UndefinedBehaviorError ` s instead of the specified exception
127
129
128
130
By default, undefined behaviors are in ` Fatal ` mode for ` fastOptJS ` and in
129
131
` Unchecked ` mode for ` fullOptJS ` .
0 commit comments