Skip to content

Commit c690338

Browse files
committed
ArithmeticExceptions are no more undefined behavior in Scala.js 1.x.
1 parent 9b0cff0 commit c690338

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

doc/semantics.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ Currently known exhaustive list of exceptions are:
103103
* `NullPointerException`
104104
* `ArrayIndexOutOfBoundsException` and `StringIndexOutOfBoundsException`
105105
* `ClassCastException`
106-
* `ArithmeticException` (such as integer division by 0)
107106
* `StackOverflowError` and other `VirtualMachineError`s
108107

109108
Because Scala.js does not receive VM support to detect such erroneous
@@ -112,6 +111,10 @@ conditions, checking them is typically too expensive.
112111
Therefore, all of these are considered
113112
[undefined behavior](http://en.wikipedia.org/wiki/Undefined_behavior).
114113

114+
**Scala.js 0.6.x only:**
115+
In Scala.js 0.6.x, `ArithmeticException`s, such as integer division by 0, are also considered undefined behavior.
116+
This is not the case in Scala.js 1.x anymore, where they are reliably thrown.
117+
115118
Some of these, however, can be configured to be compliant with the JVM
116119
specification using sbt settings.
117120
Currently, only `ClassCastException`s (thrown by invalid `asInstanceOf` calls)

0 commit comments

Comments
 (0)