emscripten icon indicating copy to clipboard operation
emscripten copied to clipboard

Closure has warnings with wasm2js

Open sbc100 opened this issue 3 years ago • 2 comments

I can't find any way to suppress the warnings about WebAssembly being overridden:

building:ERROR: Closure compiler completed with warnings and -sCLOSURE_WARNINGS=error enabled, aborting!

building:ERROR: externs.zip//webassembly.js:29:18: WARNING - [JSC_TYPE_MISMATCH] initializing variable
found   : {
  CompileError: (typeof WebAssembly.CompileError),
  Global: (typeof WebAssembly.Global),
  Instance: (typeof WebAssembly.Instance),
  LinkError: (typeof WebAssembly.LinkError),
  Memory: (typeof WebAssembly.Memory),
  Module: (typeof WebAssembly.Module),
  RuntimeError: (typeof WebAssembly.RuntimeError),
  Table: (typeof WebAssembly.Table),
  Tag: (typeof WebAssembly.Tag),
  compile: function((ArrayBuffer|ArrayBufferView)): Promise<WebAssembly.Module>,
  ...
}
required: {
  Instance: (typeof WebAssembly.Instance),
  Memory: (typeof WebAssembly.Memory),
  Module: function((ArrayBuffer|ArrayBufferView)): ?,
  RuntimeError: (typeof Error),
  instantiate: function((ArrayBuffer|ArrayBufferView), (Object|null)=): Promise<{
    instance: WebAssembly.Instance,
    module: WebAssembly.Module
  }>
}
  29| var WebAssembly = {};
                        ^^

0 error(s), 1 warning(s), 57.6% typed

Ideally we would default to warnings as errors but we don't want to do that until we fix our internal warnings: #16205

sbc100 avatar May 27 '22 19:05 sbc100

I am also seeing this warning with `-s WASM=0 -s LEGACY_VM_SUPPORT=1 --closure=1'.

manxorist avatar Dec 04 '23 19:12 manxorist

Upstream issue is here: https://github.com/google/closure-compiler/issues/4108

sbc100 avatar Apr 18 '24 00:04 sbc100