Skip to content

Commit 434a26d

Browse files
committed
Properly prune stacktrace
1 parent 9cf8454 commit 434a26d

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

lib/iex/lib/iex/evaluator.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ defmodule IEx.Evaluator do
448448
defp prune_stacktrace(stack) do
449449
stack
450450
|> Enum.reverse()
451-
|> Enum.drop_while(&(elem(&1, 0) != :elixir_eval))
451+
|> Enum.drop_while(&(elem(&1, 0) != :elixir_compiler))
452452
|> Enum.reverse()
453453
|> case do
454454
[] -> stack

lib/iex/test/iex/interaction_test.exs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,9 @@ defmodule IEx.InteractionTest do
174174
test "exception" do
175175
exception = Regex.escape("** (ArithmeticError) bad argument in arithmetic expression")
176176

177-
assert capture_iex("1 + :atom\n:this_is_still_working") =~
178-
~r/^#{exception}.+\n:this_is_still_working$/s
179-
180-
refute capture_iex("1 + :atom\n:this_is_still_working") =~ ~r/erl_eval/s
177+
result = capture_iex("1 + :atom\n:this_is_still_working")
178+
assert result =~ ~r/^#{exception}.+\n:this_is_still_working$/s
179+
refute result =~ ~r/erl_eval/s
181180
end
182181

183182
test "exception while invoking conflicting helpers" do

0 commit comments

Comments
 (0)