| 7 | // Set the constructor for the given type. |
| 8 | template<class Cls, typename... Ts> |
| 9 | void dukglue_register_constructor(duk_context* ctx, const char* name) |
| 10 | { |
| 11 | duk_c_function constructor_func = dukglue::detail::call_native_constructor<false, Cls, Ts...>; |
| 12 | |
| 13 | duk_push_c_function(ctx, constructor_func, sizeof...(Ts)); |
| 14 | |
| 15 | // set constructor_func.prototype |
| 16 | dukglue::detail::ProtoManager::push_prototype<Cls>(ctx); |
| 17 | duk_put_prop_string(ctx, -2, "prototype"); |
| 18 | |
| 19 | // set name = constructor_func |
| 20 | duk_put_global_string(ctx, name); |
| 21 | } |
| 22 | |
| 23 | template<class Cls, typename... Ts> |
| 24 | void dukglue_register_constructor_managed(duk_context* ctx, const char* name) |
nothing calls this directly
no outgoing calls
no test coverage detected