(self, command, uninstantiable)
| 202 | self.unmangled_names[name_idx] = command['as'] |
| 203 | |
| 204 | def _WriteModuleInitCall(self, command, uninstantiable): |
| 205 | header_filename = utils.ChangeExt(command['filename'], '.h') |
| 206 | with open(os.path.join(self.out_dir, header_filename), encoding='utf-8') as f: |
| 207 | imported_modules = set() |
| 208 | for line in f: |
| 209 | if 'import: ' in line: |
| 210 | line_split = line.split() |
| 211 | import_module_name = MangleModuleName(line_split[2][1:-1]) |
| 212 | imported_modules.add(import_module_name) |
| 213 | |
| 214 | if uninstantiable: |
| 215 | self.out_file.write('ASSERT_TRAP(') |
| 216 | |
| 217 | self.out_file.write('wasm2c_%s_instantiate(&%s_instance' % (self.GetModulePrefix(), self.GetModulePrefix())) |
| 218 | for imported_module in sorted(imported_modules): |
| 219 | self.out_file.write(', &%s_instance' % imported_module) |
| 220 | self.out_file.write(')') |
| 221 | |
| 222 | if uninstantiable: |
| 223 | self.out_file.write(')') |
| 224 | |
| 225 | self.out_file.write(';\n') |
| 226 | |
| 227 | def _MaybeWriteDummyModule(self): |
| 228 | if len(self.GetModuleFilenames()) == 0: |
no test coverage detected