Closure-compiler: [externs] Add WebAssembly JS API externs

Created on 16 Jun 2017  路  3Comments  路  Source: google/closure-compiler

WebAssembly has reached MVP in March 2017. WebAssembly JS API specification can be found at http://webassembly.org/docs/js/.

Externs rules of WebAssembly JS API is added in Emscripten at here.

I want to send a PR for this. Should I add externs rule in html5.js or a new webassembly.js file? It looks like I also need to regenerate src/com/google/javascript/jscomp/resources.json, how do I do that?

Note: WebAssembly is not part of JS specification, but it is usually implemented in JS engine side rather than in browser side, so this is not a browser API and Node.js also can use WebAssembly.

Most helpful comment

Hmm, what ever happened to WebAssembly externs? An up-to-date Closure Compiler is complaining about variable WebAssembly being undeclared.

Is it because externs are in contrib/externs/... as opposed to externs/browser/... where they were added initially in a PR #2534? All the other APIs in contrib/externs/... seem to be for 3rd-party libs, whereas WebAssembly is a stable API available in all browsers, seems weird that it's not colocated with other standard APIs.

All 3 comments

I would say let's put it in a new file. Our google<->github syncing process will automatically regenerate resources.json I think.

Externs added.

Hmm, what ever happened to WebAssembly externs? An up-to-date Closure Compiler is complaining about variable WebAssembly being undeclared.

Is it because externs are in contrib/externs/... as opposed to externs/browser/... where they were added initially in a PR #2534? All the other APIs in contrib/externs/... seem to be for 3rd-party libs, whereas WebAssembly is a stable API available in all browsers, seems weird that it's not colocated with other standard APIs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cramforce picture cramforce  路  5Comments

ChadKillingsworth picture ChadKillingsworth  路  7Comments

joscha picture joscha  路  5Comments

agrafix picture agrafix  路  5Comments

ChadKillingsworth picture ChadKillingsworth  路  5Comments