Skip to content

Commit ba2b4d3

Browse files
committed
Updated find_used_functions to walk super calls
Added integer_to_binary to erlang.js
1 parent 9ed0e5f commit ba2b4d3

File tree

5 files changed

+16
-4
lines changed

5 files changed

+16
-4
lines changed

lib/elixir_script/passes/find_used_functions.ex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,8 @@ defmodule ElixirScript.FindUsedFunctions do
264264
walk(params, state)
265265
end
266266

267-
defp walk({:super, _, params}, state) do
267+
defp walk({:super, _, [{_, function} | params]}, state) do
268+
walk_module(state.module, function, length(params), state.pid)
268269
walk(params, state)
269270
end
270271

lib/elixir_script/passes/find_used_modules.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ defmodule ElixirScript.FindUsedModules do
286286
end
287287
end
288288

289-
defp walk({:super, _, params}, state) do
289+
defp walk({:super, _, [{_, _} | params]}, state) do
290290
walk(params, state)
291291
end
292292

lib/elixir_script/passes/translate/form.ex

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,12 @@ defmodule ElixirScript.Translate.Form do
286286
end
287287
end
288288

289+
def compile({:default, _, _}, state) do
290+
var = :__default__
291+
var = Pattern.get_variable_name(to_string(var), state)
292+
{ ElixirScript.Translate.Identifier.make_identifier(var), state }
293+
end
294+
289295
def compile({var, _, _}, state) do
290296
var = Pattern.get_variable_name(to_string(var), state)
291297
{ ElixirScript.Translate.Identifier.make_identifier(var), state }

0 commit comments

Comments
 (0)