1
0
mirror of https://github.com/videojs/video.js.git synced 2025-01-02 06:32:07 +02:00
video.js/src
mister-ben a7c9f26c8f
fix: Refactor evented to make mincompatable with Chrome 53 (#8810)
## Description
Chrome 53 doesn't like the minified output. Specifically, it throws
`Uncaught SyntaxError: Unexpected token (` on the ternary in the
minified version of `normalizeListenArgs()`

e78bcc7b2d/src/js/mixins/evented.js (L165-L195)

Line breaks added for clarify

```js
Tt = (e, t, s) => {
  var i = t.length < 3 || t[0] === e || t[0] === e.eventBusEl_;
  let r, n, a;
  return i ? (r = e.eventBusEl_, 3 <= t.length && t.shift(), [n, a] = t) : [r, n, a] = t, ft(r, e, s), yt(n, e, s), bt(a, e, s), a = _(e, a), {
    isTargetingSelf: I,
    target: r,
    type: n,
    listener: a
  }
},
```

Chrome would be happy with this if `[r, n, a] = t` were `([r, n, a] =
t)`.

## Specific Changes proposed
Refactor `normalizeListenArgs()` slightly to use multiple statements to
coerce uglify-js to include parentheses.
Also updates uglify-js, but that in itself isn't the fix.

Fixes #8783

## Requirements Checklist
- [x] Feature implemented / Bug fixed
- [ ] If necessary, more likely in a feature request than a bug fix
- [x] Change has been verified in an actual browser - Browserstack
Chrome 53
  - [ ] Unit Tests updated or fixed
  - [ ] Docs/guides updated
- [ ] Example created ([starter template on
JSBin](https://codepen.io/gkatsev/pen/GwZegv?editors=1000#0))
- [x] Has no DOM changes which impact accessiblilty or trigger warnings
(e.g. Chrome issues tab)
  - [x] Has no changes to JSDoc which cause `npm run docs:api` to error
- [ ] Reviewed by Two Core Contributors

---------

Co-authored-by: Gary Katsevman <git@gkatsev.com>
2024-07-22 22:16:17 +02:00
..
css feat: Adds a transient button component (#8629) 2024-07-06 07:40:31 +01:00
images feat(icons): update Twitter X logo (#8764) 2024-06-11 12:58:29 -04:00
js fix: Refactor evented to make mincompatable with Chrome 53 (#8810) 2024-07-22 22:16:17 +02:00