Advertisement
Guest User

Untitled

a guest
Mar 24th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. const {wastInstructions} = require('inline-wast/lib/interpreter');
  2.  
  3. function add(a, b) {
  4. const fn = wastInstructions`
  5. (i32.const ${a})
  6. (i32.const ${b})
  7. (i32.add)
  8. `;
  9.  
  10. return fn();
  11. }
  12.  
  13. console.log(add(3, 1)); // 4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement