(
rawType,
rawPointerType,
rawConstPointerType,
baseClassRawType,
getActualTypeSignature,
getActualType,
upcastSignature,
upcast,
downcastSignature,
downcast,
name,
destructorSignature,
rawDestructor
)
| 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); |
nothing calls this directly
no test coverage detected