| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | 21x 21x 21x 21x 21x 70x 70x 70x 128x 128x 128x 70x | // @flow
import { u8 } from 'wasm-types';
import { varuint32 } from '../numbers';
import { emitString } from '../string';
import OutputStream from '../../utils/output-stream';
const emit = (exports: any[]) => {
const payload = new OutputStream();
payload.push(varuint32, exports.length, 'count');
exports.forEach(({ field, kind, index }) => {
emitString(payload, field, 'field');
payload.push(u8, kind, 'Global');
payload.push(varuint32, index, 'index');
});
return payload;
};
export default emit;
|