| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | 21x 21x 21x 158x 69x 69x 158x 69x | // @flow
// Emits function section. For function code emitter look into code.js
import { varuint32 } from '../numbers';
import OutputStream from '../../utils/output-stream';
const emit = (functions: any[]) => {
functions = functions.filter(func => func !== null);
const stream = new OutputStream();
stream.push(varuint32, functions.length, 'count');
functions.forEach(index => stream.push(varuint32, index, 'type index'));
return stream;
};
export default emit;
|