1 const fs = require('fs');
2 const process = require('process');
3 const assert = require('assert');
4 const buffer = fs.readFileSync(process.argv[2]);
6 let m = new WebAssembly.Module(buffer);
8 sections = WebAssembly.Module.customSections(m, "foo");
9 console.log('section foo', sections);
10 assert.strictEqual(sections.length, 1, "didn't create `foo` section");
11 section = new Uint8Array(sections[0]);
12 console.log('contents', section);
13 assert.strictEqual(section.length, 4, "didn't concatenate `foo` sections");