function helloWorld(stdlib, foreign, heap) {
  "use asm";

  var HEAP64 = new stdlib.Float64Array(heap);
  // this is what we're validating
  function giveThemTheAnswer() {
    var x = 2;
    var y = 40;
    return (x|0 + y|0)|0;
  }
  return { answer: giveThemTheAnswer };
}
Fork me on GitHub