Skip to content

Commit

Permalink
Deprecate wasm_import/2
Browse files Browse the repository at this point in the history
  • Loading branch information
RoyalIcing committed Nov 7, 2023
1 parent 16ba7f2 commit ffaf27a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/orb.ex
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,8 @@ defmodule Orb do
@doc """
Declare a WebAssembly import for a function or global.
"""
defmacro importw(mod, entries) when is_atom(mod) and is_list(entries) do
@deprecated "Use importw/2 instead"
defmacro wasm_import(mod, entries) when is_atom(mod) and is_list(entries) do
quote do
@wasm_imports (for {name, type} <- unquote(entries) do
%Orb.Import{module: unquote(mod), name: name, type: type}
Expand Down
4 changes: 2 additions & 2 deletions test/orb_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -260,12 +260,12 @@ defmodule OrbTest do

importw(Echo, :echo)

importw(:log,
wasm_import(:log,

Check warning on line 263 in test/orb_test.exs

View workflow job for this annotation

GitHub Actions / Build and test (26.0.2, 1.15.2)

Orb.wasm_import/2 is deprecated. Use importw/2 instead

Check warning on line 263 in test/orb_test.exs

View workflow job for this annotation

GitHub Actions / Build and test (25.3.2, 1.15.2)

Orb.wasm_import/2 is deprecated. Use importw/2 instead
int32: funcp(name: :log_i32, params: I32),
int64: funcp(name: :log_i64, params: I64)
)

importw(:time,
wasm_import(:time,

Check warning on line 268 in test/orb_test.exs

View workflow job for this annotation

GitHub Actions / Build and test (26.0.2, 1.15.2)

Orb.wasm_import/2 is deprecated. Use importw/2 instead

Check warning on line 268 in test/orb_test.exs

View workflow job for this annotation

GitHub Actions / Build and test (25.3.2, 1.15.2)

Orb.wasm_import/2 is deprecated. Use importw/2 instead
seconds_since_unix_epoch: funcp(name: :unix_time, result: I64)
)

Expand Down

0 comments on commit ffaf27a

Please sign in to comment.