MCPcopy
hub / github.com/putyy/res-downloader / __embind_register_class

Function __embind_register_class

frontend/src/assets/js/decrypt.js:2642–2749  ·  view source on GitHub ↗
(
      rawType,
      rawPointerType,
      rawConstPointerType,
      baseClassRawType,
      getActualTypeSignature,
      getActualType,
      upcastSignature,
      upcast,
      downcastSignature,
      downcast,
      name,
      destructorSignature,
      rawDestructor
    )

Source from the content-addressed store, hash-verified

2640 throw new UnboundTypeError(message + ': ' + unboundTypes.map(getTypeName).join([', ']));
2641 }
2642 function __embind_register_class(
2643 rawType,
2644 rawPointerType,
2645 rawConstPointerType,
2646 baseClassRawType,
2647 getActualTypeSignature,
2648 getActualType,
2649 upcastSignature,
2650 upcast,
2651 downcastSignature,
2652 downcast,
2653 name,
2654 destructorSignature,
2655 rawDestructor
2656 ) {
2657 name = readLatin1String(name);
2658 getActualType = embind__requireFunction(getActualTypeSignature, getActualType);
2659 if (upcast) {
2660 upcast = embind__requireFunction(upcastSignature, upcast);
2661 }
2662 if (downcast) {
2663 downcast = embind__requireFunction(downcastSignature, downcast);
2664 }
2665 rawDestructor = embind__requireFunction(destructorSignature, rawDestructor);
2666 var legalFunctionName = makeLegalFunctionName(name);
2667
2668 exposePublicSymbol(legalFunctionName, function() {
2669 // this code cannot run if baseClassRawType is zero
2670 throwUnboundTypeError('Cannot construct ' + name + ' due to unbound types', [baseClassRawType]);
2671 });
2672
2673 whenDependentTypesAreResolved(
2674 [rawType, rawPointerType, rawConstPointerType],
2675 baseClassRawType ? [baseClassRawType] : [],
2676 function(base) {
2677 base = base[0];
2678
2679 var baseClass;
2680 var basePrototype;
2681 if (baseClassRawType) {
2682 baseClass = base.registeredClass;
2683 basePrototype = baseClass.instancePrototype;
2684 } else {
2685 basePrototype = ClassHandle.prototype;
2686 }
2687
2688 var constructor = createNamedFunction(legalFunctionName, function() {
2689 if (Object.getPrototypeOf(this) !== instancePrototype) {
2690 throw new BindingError("Use 'new' to construct " + name);
2691 }
2692 if (undefined === registeredClass.constructor_body) {
2693 throw new BindingError(name + " has no accessible constructor");
2694 }
2695 var body = registeredClass.constructor_body[arguments.length];
2696 if (undefined === body) {
2697 throw new BindingError("Tried to invoke ctor of " + name + " with invalid number of parameters (" + arguments.length + ") - expected (" + Object.keys(registeredClass.constructor_body).toString() + ") parameters instead!");
2698 }
2699 return body.apply(this, arguments);

Callers

nothing calls this directly

Calls 8

readLatin1StringFunction · 0.85
embind__requireFunctionFunction · 0.85
makeLegalFunctionNameFunction · 0.85
exposePublicSymbolFunction · 0.85
throwUnboundTypeErrorFunction · 0.85
createNamedFunctionFunction · 0.85
replacePublicSymbolFunction · 0.85

Tested by

no test coverage detected