diff options
author | Daniel Wirtz <dcode@dcode.io> | 2019-10-12 00:41:32 +0200 |
---|---|---|
committer | Alon Zakai <azakai@google.com> | 2019-10-11 15:41:32 -0700 |
commit | 66cb7b3f80f6ce32f426c3cb52eaf19430289ac2 (patch) | |
tree | c93ad30df8f2e0959d914afe42470ceeb3996e7d /test/binaryen.js/custom-section.js | |
parent | 4e80fde446764102fe5685496f351f0539377ff6 (diff) | |
download | binaryen-66cb7b3f80f6ce32f426c3cb52eaf19430289ac2.tar.gz binaryen-66cb7b3f80f6ce32f426c3cb52eaf19430289ac2.tar.bz2 binaryen-66cb7b3f80f6ce32f426c3cb52eaf19430289ac2.zip |
Add BinaryenAddCustomSection API (#2381)
This adds a new BinaryenAddCustomSection API so a generator can add arbitrary
custom sections to a module.
Diffstat (limited to 'test/binaryen.js/custom-section.js')
-rw-r--r-- | test/binaryen.js/custom-section.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/binaryen.js/custom-section.js b/test/binaryen.js/custom-section.js new file mode 100644 index 000000000..f61af0096 --- /dev/null +++ b/test/binaryen.js/custom-section.js @@ -0,0 +1,11 @@ +function assert(x) { + if (!x) throw 'error!'; +} + +Binaryen.setAPITracing(true); +var module = new Binaryen.Module(); + +module.addCustomSection("hello", [119, 111, 114, 108, 100]); + +assert(module.validate()); +console.log(module.emitText()); |