web 3d图形渲染器
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.

18 lines
682 B

  1. import getPrototypeOf from "./getPrototypeOf.js";
  2. import isNativeReflectConstruct from "./isNativeReflectConstruct.js";
  3. import possibleConstructorReturn from "./possibleConstructorReturn.js";
  4. export default function _createSuper(Derived) {
  5. var hasNativeReflectConstruct = isNativeReflectConstruct();
  6. return function _createSuperInternal() {
  7. var Super = getPrototypeOf(Derived),
  8. result;
  9. if (hasNativeReflectConstruct) {
  10. var NewTarget = getPrototypeOf(this).constructor;
  11. result = Reflect.construct(Super, arguments, NewTarget);
  12. } else {
  13. result = Super.apply(this, arguments);
  14. }
  15. return possibleConstructorReturn(this, result);
  16. };
  17. }