Index: test/mjsunit/wasm/instantiate-module-basic.js |
diff --git a/test/mjsunit/wasm/instantiate-module-basic.js b/test/mjsunit/wasm/instantiate-module-basic.js |
index 77292a38eeaabb823d91a066d1d77a8ed2c63fc6..6e7791d42eac4f96fcc97d1b5970e063bb32e769 100644 |
--- a/test/mjsunit/wasm/instantiate-module-basic.js |
+++ b/test/mjsunit/wasm/instantiate-module-basic.js |
@@ -247,3 +247,21 @@ assertFalse(WebAssembly.validate(bytes(88, 88, 88, 88, 88, 88, 88, 88))); |
builder.exportMemoryAs('memory'); |
assertThrows(() => builder.instantiate(), WebAssembly.CompileError); |
})(); |
+ |
+(function TestIterableExports() { |
+ print("TestIterableExports..."); |
+ let builder = new WasmModuleBuilder; |
+ builder.addExport("a", builder.addFunction("", kSig_v_v).addBody([])); |
+ builder.addExport("b", builder.addFunction("", kSig_v_v).addBody([])); |
+ builder.addExport("c", builder.addFunction("", kSig_v_v).addBody([])); |
+ builder.addExport("d", builder.addFunction("", kSig_v_v).addBody([])); |
+ builder.addExport("e", builder.addGlobal(kWasmI32, false)); |
+ |
+ let module = new WebAssembly.Module(builder.toBuffer()); |
+ let instance = new WebAssembly.Instance(module); |
+ |
+ let exports_count = 0; |
+ for (var e in instance.exports) ++exports_count; |
+ |
+ assertEquals(5, exports_count); |
+})(); |