Skip to content

Commit

Permalink
Add Macro.escape to redefined attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
Arjan Scherpenisse committed Oct 1, 2018
1 parent e0eeff9 commit 68014d1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/decorators/decorate.ex
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 66,11 @@ defmodule Decorator.Decorate do
end)
end

defp reject_empty_clauses(all) do
Enum.reject(all, fn {_kind, _fun, _args, _guards, body, _decorators, _attrs} -> body == nil end)
end
defp reject_empty_clauses(all) do
Enum.reject(all, fn {_kind, _fun, _args, _guards, body, _decorators, _attrs} ->
body == nil
end)
end

defp implied_arities(args) do
arity = Enum.count(args)
Expand Down Expand Up @@ -101,7 103,7 @@ defmodule Decorator.Decorate do
attrs =
attrs
|> Enum.map(fn {attr, value} ->
{:@, [], [{attr, [], [value]}]}
{:@, [], [{attr, [], [Macro.escape(value)]}]}
end)

arity = Enum.count(args || [])
Expand Down

0 comments on commit 68014d1

Please sign in to comment.