From e6ea66898b90cd7b468aa5a78589672edf557389 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 11 Jul 2017 18:38:32 -0700 Subject: 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/ --- test/binaryen.js/call_import_error.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 test/binaryen.js/call_import_error.js (limited to 'test/binaryen.js/call_import_error.js') 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 -- cgit v1.2.3