mirror of
https://github.com/shaka-project/shaka-player.git
synced 2026-06-26 17:46:26 +03:00
9ece285b92
In v3.0, we changed our plugin interfaces so that all are factories that return objects. We no longer call those with "new" as we did in v2.5. We provided backward compatibility and a deprecation warning to alert applications to update their usage of those interfaces. However, this compatibility shim was broken for ES6 classes, which behaved differently than ES5 constructor functions. This fixes the shim and adds regression tests. The tests were tricky because we use Babel to transpile our tests, but we needed raw, untranspiled code to define a class to test these features. So we use eval and some associated trickery to get exactly the different kinds of plugin registrations we intend to support. These tests are skipped on non-ES6 browsers. Fixes #2958 Change-Id: Ife8b63c0d89f4ea0aff085d3a4c156c4eb657604