autobahn-js icon indicating copy to clipboard operation
autobahn-js copied to clipboard

TimeoutError unintentionally mangled in autobahn.min.js

Open gruns opened this issue 6 years ago • 1 comments

Issues on https://github.com/crossbario/autobahn-js-browser are closed, so opening this Issue here.

TimeoutError in the minified autobahn-js-browser/autobahn.min.js is incorrectly mangled to a. See

  • https://jsfiddle.net/mbcz682j/

This breaks TimeoutError testing, e.g.

try {
    session.call('foo').timeout(123)
} catch (err) {
    if (err.name === 'TimeoutError') {  // err.name is 'a', not 'TimeoutError'.
      ...
    }
}

TimeoutError isn't mangled in the unminified autobahn-js-browser/autobahn.js.

  • https://jsfiddle.net/b0Ls05qe/

The fix is (likely) just to preserve TimeoutError in the build/minification process (and any other unintentionally mangled names).

gruns avatar Apr 27 '18 07:04 gruns

All the minimization is done by Google Closure compiler, so if the mangling is incorrect, this issue is highly likely upstream.

oberstet avatar Apr 27 '18 08:04 oberstet