Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/decorator/decorate.ex
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ defmodule Decorator.Decorate do
attrs = extract_attributes(env.module, body)
decorated = {kind, fun, args, guards, body, decorators, attrs}

Module.put_attribute(env.module, :decorated, decorated)
Module.put_attribute(env.module, :decorator_decorated, decorated)
Module.delete_attribute(env.module, :decorate)
end

Expand All @@ -34,8 +34,8 @@ defmodule Decorator.Decorate do
end

defmacro before_compile(env) do
decorated = Module.get_attribute(env.module, :decorated) |> Enum.reverse()
Module.delete_attribute(env.module, :decorated)
decorated = Module.get_attribute(env.module, :decorator_decorated) |> Enum.reverse()
Module.delete_attribute(env.module, :decorator_decorated)

decorated_functions = decorated_functions(decorated)

Expand Down
2 changes: 1 addition & 1 deletion lib/decorator/define.ex
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ defmodule Decorator.Define do

Module.register_attribute(__MODULE__, :decorate_all, accumulate: true)
Module.register_attribute(__MODULE__, :decorate, accumulate: true)
Module.register_attribute(__MODULE__, :decorated, accumulate: true)
Module.register_attribute(__MODULE__, :decorator_decorated, accumulate: true)

@on_definition {Decorator.Decorate, :on_definition}
@before_compile {Decorator.Decorate, :before_compile}
Expand Down