Skip to content

Commit baa2599

Browse files
committed
Do not escape dbg options, closes #14839
1 parent a5c9121 commit baa2599

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

lib/elixir/lib/macro.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2700,7 +2700,7 @@ defmodule Macro do
27002700
:ok
27012701
end
27022702

2703-
prelude = quote do: options = unquote(Macro.escape(options))
2703+
prelude = quote do: options = unquote(options)
27042704
acc = {prelude, dbg_format_header(env)}
27052705

27062706
{acc, nil} =

lib/elixir/test/elixir/kernel_test.exs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1484,6 +1484,11 @@ defmodule KernelTest do
14841484
assert output =~ "3"
14851485
end
14861486

1487+
test "prints the given expression with complex options" do
1488+
output = capture_io(fn -> assert dbg(123, [] ++ []) == 123 end)
1489+
assert output =~ "kernel_test.exs"
1490+
end
1491+
14871492
test "doesn't print any colors if :syntax_colors is []" do
14881493
output =
14891494
capture_io(fn ->

0 commit comments

Comments
 (0)