summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/wasm/webapi/esm-integration/exported-names.tentative.html
blob: 16a9c59787bc94f050c2fcdc522625858adcd03f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<!doctype html>
<title>Exported names from a WebAssembly module</title>

<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script type=module>
setup({ single_test: true });
import * as mod from "./resources/exported-names.wasm";
assert_array_equals(Object.getOwnPropertyNames(mod).sort(),
                    ["func", "glob", "mem", "tab"]);
assert_true(mod.func instanceof Function);
assert_true(mod.mem instanceof WebAssembly.Memory);
assert_true(mod.glob instanceof WebAssembly.Global);
assert_true(mod.tab instanceof WebAssembly.Table);
assert_throws_js(TypeError, () => { mod.func = 2; });
done();
</script>