emoji-mart-lazyload/src/polyfills/possibleConstructorReturn.js

8 lines
267 B
JavaScript

export default function possibleConstructorReturn(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
};