Skip to content

Commit b3277f8

Browse files
committed
Update super implementation
1 parent c2c743c commit b3277f8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/elixir_script/passes/translate/form.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ defmodule ElixirScript.Translate.Form do
228228
Remote.compile(ast, state)
229229
end
230230

231-
def compile({:super, _, params}, state) when is_list(params) do
231+
def compile({:super, _, [_ | params]}, state) when is_list(params) do
232232
{function_name, _} = Map.get(state, :function)
233233
{var_decs, params} = compile_params(params, state)
234234

test/passes/translate/form_test.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ defmodule ElixirScript.Translate.Forms.Test do
9797
end
9898

9999
test "super" do
100-
ast = {:super, [], [1]}
101-
state = %{function: {:my_function, nil}}
100+
ast = {:super, [], [{:def, :my_function}, 1]}
101+
state = %{function: {:my_function, nil}, vars: %{}}
102102

103103
{js_ast, _} = Form.compile(ast, state)
104104
assert js_ast == J.call_expression(

0 commit comments

Comments
 (0)