1<!doctype html> 2<title>Exported names from a WebAssembly module</title> 3 4<script src="/resources/testharness.js"></script> 5<script src="/resources/testharnessreport.js"></script> 6<script type=module> 7setup({ single_test: true }); 8import * as mod from "./resources/exported-names.wasm"; 9assert_array_equals(Object.getOwnPropertyNames(mod).sort(), 10 ["func", "glob", "mem", "tab"]); 11assert_true(mod.func instanceof Function); 12assert_true(mod.mem instanceof WebAssembly.Memory); 13assert_true(mod.glob instanceof WebAssembly.Global); 14assert_true(mod.tab instanceof WebAssembly.Table); 15assert_throws_js(TypeError, () => { mod.func = 2; }); 16done(); 17</script> 18