Skip to content

Closure warnings in Emscripten builds #5062

@tlively

Description

@tlively

Building binaryen.js gives warnings like the following:

building:WARNING: /tmp/emscripten_temp_vx7q3baw/binaryen_js.js.pp.js.jso.js.jso.js.jso.js.jso.js:9381:1: WARNING - [JSC_USED_GLOBAL_THIS] dangerous use of the global this object
  9381|  this["ptr"] = relooper;
         ^^^^

/tmp/emscripten_temp_vx7q3baw/binaryen_js.js.pp.js.jso.js.jso.js.jso.js.jso.js:9382:1: WARNING - [JSC_USED_GLOBAL_THIS] dangerous use of the global this object
  9382|  this["addBlock"] = function(code) {
         ^^^^

/tmp/emscripten_temp_vx7q3baw/binaryen_js.js.pp.js.jso.js.jso.js.jso.js.jso.js:9385:1: WARNING - [JSC_USED_GLOBAL_THIS] dangerous use of the global this object
  9385|  this["addBranch"] = function(from, to, condition, code) {
         ^^^^

/tmp/emscripten_temp_vx7q3baw/binaryen_js.js.pp.js.jso.js.jso.js.jso.js.jso.js:9388:1: WARNING - [JSC_USED_GLOBAL_THIS] dangerous use of the global this object
  9388|  this["addBlockWithSwitch"] = function(code, condition) {
         ^^^^

/tmp/emscripten_temp_vx7q3baw/binaryen_js.js.pp.js.jso.js.jso.js.jso.js.jso.js:9391:1: WARNING - [JSC_USED_GLOBAL_THIS] dangerous use of the global this object
  9391|  this["addBranchForSwitch"] = function(from, to, indexes, code) {
         ^^^^

/tmp/emscripten_temp_vx7q3baw/binaryen_js.js.pp.js.jso.js.jso.js.jso.js.jso.js:9394:1: WARNING - [JSC_USED_GLOBAL_THIS] dangerous use of the global this object
  9394|  this["renderAndDispose"] = function(entry, labelHelper) {
         ^^^^

/tmp/emscripten_temp_vx7q3baw/binaryen_js.js.pp.js.jso.js.jso.js.jso.js.jso.js:9401:1: WARNING - [JSC_USED_GLOBAL_THIS] dangerous use of the global this object
  9401|  this["ptr"] = runner;
         ^^^^

/tmp/emscripten_temp_vx7q3baw/binaryen_js.js.pp.js.jso.js.jso.js.jso.js.jso.js:9402:1: WARNING - [JSC_USED_GLOBAL_THIS] dangerous use of the global this object
  9402|  this["setLocalValue"] = function(index, valueExpr) {
         ^^^^

/tmp/emscripten_temp_vx7q3baw/binaryen_js.js.pp.js.jso.js.jso.js.jso.js.jso.js:9405:1: WARNING - [JSC_USED_GLOBAL_THIS] dangerous use of the global this object
  9405|  this["setGlobalValue"] = function(name, valueExpr) {
         ^^^^

/tmp/emscripten_temp_vx7q3baw/binaryen_js.js.pp.js.jso.js.jso.js.jso.js.jso.js:9408:1: WARNING - [JSC_USED_GLOBAL_THIS] dangerous use of the global this object
  9408|  this["runAndDispose"] = function(expr) {
         ^^^^

/tmp/emscripten_temp_vx7q3baw/binaryen_js.js.pp.js.jso.js.jso.js.jso.js.jso.js:10209:11: WARNING - [JSC_USED_GLOBAL_THIS] dangerous use of the global this object
  10209|     return this.constructor[memberName](this[thisPtr], ...args);
                    ^^^^

/tmp/emscripten_temp_vx7q3baw/binaryen_js.js.pp.js.jso.js.jso.js.jso.js.jso.js:10209:40: WARNING - [JSC_USED_GLOBAL_THIS] dangerous use of the global this object
  10209|     return this.constructor[memberName](this[thisPtr], ...args);
                                                 ^^^^

/tmp/emscripten_temp_vx7q3baw/binaryen_js.js.pp.js.jso.js.jso.js.jso.js.jso.js:10231:1: WARNING - [JSC_USED_GLOBAL_THIS] dangerous use of the global this object
  10231|  this[thisPtr] = expr;
          ^^^^

/tmp/emscripten_temp_vx7q3baw/binaryen_js.js.pp.js.jso.js.jso.js.jso.js.jso.js:11524:10: WARNING - [JSC_NOT_A_CONSTRUCTOR] cannot instantiate non-constructor
  11524|    return new Function(func);
                   ^^^^^^^^^^^^^^^^^^

/tmp/emscripten_temp_vx7q3baw/binaryen_js.js.pp.js.jso.js.jso.js.jso.js.jso.js:11527:2: WARNING - [JSC_USED_GLOBAL_THIS] dangerous use of the global this object
  11527|   this[thisPtr] = func;
           ^^^^

externs.zip//webassembly.js:29:18: WARNING - [JSC_TYPE_MISMATCH] initializing variable
found   : {
  CompileError: (typeof WebAssembly.CompileError),
  Exception: (typeof WebAssembly.Exception),
  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),
  ...
}
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), 16 warning(s), 63.6% typed

These should be fixed!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions