Skip to content

Commit

Permalink
misc/wasm: pollute global JS namespace less
Browse files Browse the repository at this point in the history
This commit changes wasm_exec.js so it only puts the single
name "go" into the global namespace. Other names became private
or were turned into a property/method of "go".

Change-Id: I633829dfd3c06936f092c0a14b9978bf855e41fe
Reviewed-on: https://go-review.googlesource.com/112980
Reviewed-by: Brad Fitzpatrick <[email protected]>
Reviewed-by: Agniva De Sarker <[email protected]>
  • Loading branch information
neelance authored and bradfitz committed May 15, 2018
1 parent 3027932 commit db91ee3
Show file tree
Hide file tree
Showing 2 changed files with 315 additions and 308 deletions.
4 changes: 2 additions & 2 deletions misc/wasm/wasm_exec.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
async function loadAndCompile() {
let resp = await fetch("test.wasm");
let bytes = await resp.arrayBuffer();
await compile(bytes);
await go.compile(bytes);
document.getElementById("runButton").disabled = false;
}

loadAndCompile();
</script>

<button onClick="console.clear(); run();" id="runButton" disabled>Run</button>
<button onClick="console.clear(); go.run();" id="runButton" disabled>Run</button>
</body>

</html>
Loading

0 comments on commit db91ee3

Please sign in to comment.