You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, correct me if I'm wrong, but WebAssembly is not a web-specific technology but a "core" JavaScript API.
NodeJS for example also supports creating/running WebAssembly instances.
And on the MDN, it is classified as a "global object", and not something specific to the web: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects#webassembly
As a consequence, it is not currently possible to use WebAssembly from JavaScript without importing the dom library.
An example of that is that the @types/node/wasi.d.ts file contains dummy return values for its functions:
WASM isn't part of ECMAScript spec and it's just browsers/runtime providing JS API.
Similar to console which is not part of ES spec, but it's may be non-trivial to find runtime that doesn't have it.
lib Update Request
Hi 👋
lib.dom.d.ts
contains a namespace namedWebAssembly
in accordance with https://webassembly.github.io/spec/js-api/However, correct me if I'm wrong, but WebAssembly is not a web-specific technology but a "core" JavaScript API.
NodeJS for example also supports creating/running WebAssembly instances.
And on the MDN, it is classified as a "global object", and not something specific to the web: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects#webassembly
As a consequence, it is not currently possible to use WebAssembly from JavaScript without importing the
dom
library.An example of that is that the
@types/node/wasi.d.ts
file contains dummy return values for its functions:https://github.com/DefinitelyTyped/DefinitelyTyped/blob/8745cf9f8425bfcabaed69fba1684082a18f3191/types/node/wasi.d.ts#L136
Configuration Check
This issue applies to situations where
lib
does not containsdom
.Missing / Incorrect Definition
The missing definition is the
WebAssembly
object/namespace and everything below.WebAssembly
shouldn't be present in thedom
library but, if I'm not mistaken, as a language feature.Sample Code
Any code that uses WebAssembly doesn't work, for example:
Documentation Link
https://www.w3.org/TR/wasm-js-api-1/
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects#webassembly
The text was updated successfully, but these errors were encountered: