Skip to content

Commit

Permalink
Mark StackMarker wrapper methods as @noinline to make sure they d…
Browse files Browse the repository at this point in the history
…on't get eliminated by the Scala.js optimizer
  • Loading branch information
lihaoyi committed Sep 10, 2017
1 parent a4d4d63 commit f38bd2b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions utest/shared/src/main/scala/utest/framework/StackMarker.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ package utest.framework
* meant to be filtered out later.
*/
object StackMarker {
// Ask Scalac/Scala.js nicely to try and avoid inlining these two marker methods,
// to make sure they don't disappear from the stack traces
@noinline
def dropInside[T](t: => T): T = t
@noinline
def dropOutside[T](t: => T): T = t
def filterCallStack(stack: Seq[StackTraceElement]): Seq[StackTraceElement] = {
val droppedInside = stack.indexWhere(x =>
Expand Down

0 comments on commit f38bd2b

Please sign in to comment.