(module, name, type, kind = kExternalFunction)
| 1658 | } |
| 1659 | |
| 1660 | addImport(module, name, type, kind = kExternalFunction) { |
| 1661 | if (this.functions.length != 0) { |
| 1662 | throw new Error('Imported functions must be declared before local ones'); |
| 1663 | } |
| 1664 | let type_index = (typeof type) == 'number' ? type : this.addType(type); |
| 1665 | this.imports.push({module, name, kind, type_index}); |
| 1666 | return this.num_imported_funcs++; |
| 1667 | } |
| 1668 | |
| 1669 | addImportedGlobal(module, name, type, mutable = false, shared = false) { |
| 1670 | if (this.globals.length != 0) { |