]> Cypherpunks.ru repositories - gostls13.git/commit
misc/wasm: expect environment to provide polyfills
authorRichard Musiol <mail@richard-musiol.de>
Fri, 3 Sep 2021 19:58:57 +0000 (21:58 +0200)
committerRichard Musiol <neelance@gmail.com>
Sat, 16 Oct 2021 14:50:21 +0000 (14:50 +0000)
commit680caf15355057ca84857a2a291b6f5c44e73329
tree14418cfc3261c8c359f53ff55dc131fde599b94f
parented1c8db308029bd82e6de4d547196f7f841236bb
misc/wasm: expect environment to provide polyfills

The list of environments to support with wasm_exec.js was becoming too
large to maintain. With this change, wasm_exec.js expects that the
environment provides all necessary polyfills.

The standardized "globalThis" is used for accessing the environment.
wasm_exec.js now only provides stub fallbacks for globalThis.fs and
globalThis.process.

All code specific to Node.js is now in a separate file.

Change-Id: I076febbd94d4d7845260faad972f450f74a7b983
Reviewed-on: https://go-review.googlesource.com/c/go/+/347353
Trust: Richard Musiol <neelance@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
misc/wasm/go_js_wasm_exec
misc/wasm/wasm_exec.js
misc/wasm/wasm_exec_node.js [new file with mode: 0644]