Skip to content

Commit 1773cc5

Browse files
committed
Modules now use export default declarations. Fixes #138
1 parent dda9114 commit 1773cc5

File tree

13 files changed

+2666
-2659
lines changed

13 files changed

+2666
-2659
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* Began writing some of the standard libraries in Elixir instead of JavaScript
77
* Added `JS.import/1`
88
* Added support for multi alias/require/imports statements
9+
* exports are now default exports
910

1011
* Breaking
1112
* `compile`, `compile_path`, and `compile_quoted` opts parameter now expects a map

lib/elixir_script/translator/import.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ defmodule ElixirScript.Translator.Import do
1414
defp do_make_import(import_name, file_name) do
1515
root = ElixirScript.Translator.State.get().compiler_opts.root
1616

17-
import_specifier = JS.import_namespace_specifier(
17+
import_specifier = JS.import_default_specifier(
1818
JS.identifier(import_name)
1919
)
2020

lib/elixir_script/translator/module.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ defmodule ElixirScript.Translator.Module do
5050
exported_functions = Enum.map(exported_functions, fn({_key, value}) -> value end)
5151
private_functions = Enum.map(private_functions, fn({_key, value}) -> value end)
5252

53-
default = JS.export_named_declaration(exported_object)
53+
default = JS.export_default_declaration(exported_object)
5454

5555
result = %{
5656
name: Utils.quoted_to_name({:__aliases__, [], module }),

0 commit comments

Comments
 (0)