Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const {wastInstructions} = require('inline-wast/lib/interpreter');
- function add(a, b) {
- const fn = wastInstructions`
- (i32.const ${a})
- (i32.const ${b})
- (i32.add)
- `;
- return fn();
- }
- console.log(add(3, 1)); // 4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement