You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

browser-hacks.js 863B

123456789101112131415161718192021
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.setPrototypeOf = exports.getConstructorName = void 0;
  4. function setPrototypeOf(object, prototype) {
  5. Object.setPrototypeOf
  6. ? Object.setPrototypeOf(object, prototype)
  7. :
  8. (object.__proto__ = prototype);
  9. }
  10. exports.setPrototypeOf = setPrototypeOf;
  11. function getConstructorName(object) {
  12. if (object.constructor.name) {
  13. return object.constructor.name;
  14. }
  15. const constructorString = object.constructor.toString();
  16. const functionConstructor = constructorString.match(/^function\s+([^(]*)/);
  17. const classConstructor = constructorString.match(/^class\s([^\s]*)/);
  18. return functionConstructor ? functionConstructor[1] : classConstructor[1];
  19. }
  20. exports.getConstructorName = getConstructorName;
  21. //# sourceMappingURL=browser-hacks.js.map