Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
stonechoe committed Sep 12, 2024
1 parent a52bf45 commit 091deb6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/main/scala/esmeta/error/InterpreterError.scala
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,5 @@ case class AssertionFail(expr: Expr)
case class OutOfRange(list: ListObj, k: Int)
extends InterpreterError(s"out of range: $k of $list")

case class BranchNotYetSupported()
extends InterpreterError("Partial Interpreter can't handle branch for now")
case class RuntimeValueNotSupported(msg: String)
extends InterpreterError(s"Peval can't handle runtime value: $msg")
2 changes: 1 addition & 1 deletion src/main/scala/esmeta/peval/PartialInterpreter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class PartialInterpreter(
s"eval[cs:${st.callStack.size}]: condition = ${condval}",
);
condval match
case RuntimeValue => throw BranchNotYetSupported()
case RuntimeValue => throw RuntimeValueNotSupported("branch")
case b => if (b.asBool) thenNode else elseNode
},
st.func,
Expand Down

0 comments on commit 091deb6

Please sign in to comment.