Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Custom Element instance creation in IE11, redo
This is a continuation of ampproject#25245. All of our Custom Elements extend from a common `CustomAmpElement` class, which itself extends from `HTMLElementPolyfill`. In ampproject#27470, I removed the `constructor` from `CustomAmpElement` class. But, because it's a subclass and must have a `constructor` that calls `super()`, Closure replaced it with a `constructor() { superClass.apply(this, arguments); }` when transpiling. But, due to the same faulty inheritance chain described in ampproject#25245, `HTMLElementPolyfill` doesn't inherit an `apply` method! So doing `superClass.apply()` throws an error. 😭 This PR installs all important Function methods onto our polyfill, to be resilient to any future changes in the instance creation.
- Loading branch information