How to refactor ES6 class which uses "this" as a parameter in super?

Viewed 38

ol-geocoder is a an extension to the OpenLayers library. Since the latest major update to v7, OpenLayers ships with ES6 classes. So the extensions which were transpiling classes to ES5 are now incompatible with OpenLayers v7.

ol-layerswitcher solved this issue by removing babel transpiling. I am trying the same with ol-geocoder but the Base class constructor is written in such a way that it accesses this before calling super and even uses this while calling super which throws an error since this cannot be accessed before calling super.

How should I refactor this code to call super before using this?

0 Answers
Related