summaryrefslogtreecommitdiff
path: root/test/binaryen.js/call_import_error.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2017-07-11 18:38:32 -0700
committerGitHub <noreply@github.com>2017-07-11 18:38:32 -0700
commite6ea66898b90cd7b468aa5a78589672edf557389 (patch)
tree96772fc2b58c3690416df37a7881544990009c94 /test/binaryen.js/call_import_error.js
parent812943d51bac4767c4b7f749f17c26277e27f796 (diff)
downloadbinaryen-e6ea66898b90cd7b468aa5a78589672edf557389.tar.gz
binaryen-e6ea66898b90cd7b468aa5a78589672edf557389.tar.bz2
binaryen-e6ea66898b90cd7b468aa5a78589672edf557389.zip
add docs and error hints when a Call should be a CallImport (#1081)
* add docs and error hints when a Call should be a CallImport * fix binaryen API docs in docs/
Diffstat (limited to 'test/binaryen.js/call_import_error.js')
-rw-r--r--test/binaryen.js/call_import_error.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/binaryen.js/call_import_error.js b/test/binaryen.js/call_import_error.js
new file mode 100644
index 000000000..4434584b5
--- /dev/null
+++ b/test/binaryen.js/call_import_error.js
@@ -0,0 +1,13 @@
+var module = new Binaryen.Module();
+
+var signature = module.addFunctionType("v", Binaryen.none, []);
+module.addImport("fn", "env", "fn", signature);
+
+module.addFunction("main", signature, [], module.block("", [
+ module.call("fn", [], Binaryen.none) // should be callImport
+]));
+module.addExport("main", "main");
+
+console.log(module.emitText());
+
+module.validate(); // fails