Skip to content

Commit 97188b7

Browse files
committed
Allow for global JS modules and classes to have implementations for protocols
1 parent 5165df5 commit 97188b7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/elixir_script/translator/kernel/defimpl.ex

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ defmodule ElixirScript.Translator.Defimpl do
113113
JS.identifier(:Object)
114114
end
115115

116+
defp map_to_js({:__aliases__, context, [:JS | rest]}, env) do
117+
ElixirScript.Translator.JS.translate_js_module({:__aliases__, context, rest}, env)
118+
|> elem(0)
119+
end
120+
116121
defp map_to_js({:__aliases__, _, [:Any]}, _) do
117122
JS.identifier(:null)
118123
end

0 commit comments

Comments
 (0)