Skip to content

Commit 203bf23

Browse files
committed
Scala.js: Complete the set of semantics to be made compliant.
This allows to run two more tests.
1 parent e53f5cb commit 203bf23

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

sjs-compiler-tests/test/scala/dotty/tools/dotc/ScalaJSLink.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ object ScalaJSLink:
1717
Semantics.Defaults
1818
.withAsInstanceOfs(CheckedBehavior.Compliant)
1919
.withArrayIndexOutOfBounds(CheckedBehavior.Compliant)
20+
.withArrayStores(CheckedBehavior.Compliant)
21+
.withNegativeArraySizes(CheckedBehavior.Compliant)
22+
.withNullPointers(CheckedBehavior.Compliant)
23+
.withStringIndexOutOfBounds(CheckedBehavior.Compliant)
2024
.withModuleInit(CheckedBehavior.Compliant)
2125
end compliantSemantics
2226

tests/run/exceptions-2.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// scalajs: --skip
1+
// scalajs: --compliant-semantics
22

33
/*
44
* Try exception handling and finally blocks.

tests/run/exceptions-nest.scala

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// scalajs: --skip
1+
// scalajs: --compliant-semantics
22

33
object Test extends App {
44

@@ -12,9 +12,12 @@ object Test extends App {
1212
try { println(test8) } catch { case _: Throwable => println("OK") }
1313
println(test9)
1414
println(test10)
15-
println(test11)
15+
portablePrintln(test11)
1616
println(test12)
1717

18+
def portablePrintln(x: Any): Unit =
19+
println(if (x == ()) "()" else x)
20+
1821
def test1 = {
1922
var x = 1
2023
try {

0 commit comments

Comments
 (0)