Skip to content

Commit

Permalink
Scala.js: Complete the set of semantics to be made compliant.
Browse files Browse the repository at this point in the history
This allows to run two more tests.
  • Loading branch information
sjrd committed Jan 17, 2025
1 parent e53f5cb commit 203bf23
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ object ScalaJSLink:
Semantics.Defaults
.withAsInstanceOfs(CheckedBehavior.Compliant)
.withArrayIndexOutOfBounds(CheckedBehavior.Compliant)
.withArrayStores(CheckedBehavior.Compliant)
.withNegativeArraySizes(CheckedBehavior.Compliant)
.withNullPointers(CheckedBehavior.Compliant)
.withStringIndexOutOfBounds(CheckedBehavior.Compliant)
.withModuleInit(CheckedBehavior.Compliant)
end compliantSemantics

Expand Down
2 changes: 1 addition & 1 deletion tests/run/exceptions-2.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// scalajs: --skip
// scalajs: --compliant-semantics

/*
* Try exception handling and finally blocks.
Expand Down
7 changes: 5 additions & 2 deletions tests/run/exceptions-nest.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// scalajs: --skip
// scalajs: --compliant-semantics

object Test extends App {

Expand All @@ -12,9 +12,12 @@ object Test extends App {
try { println(test8) } catch { case _: Throwable => println("OK") }
println(test9)
println(test10)
println(test11)
portablePrintln(test11)
println(test12)

def portablePrintln(x: Any): Unit =
println(if (x == ()) "()" else x)

def test1 = {
var x = 1
try {
Expand Down

0 comments on commit 203bf23

Please sign in to comment.